How to get pinch effect to an image in iphone - iphone

Thanks in advance.
I want to get the pinch effect to an image means i want to change the shape of an image when i perform pinching on an image. I don't know is it possible or not, if it is possible can any one help me to do it using objective c in iphone.

Actually your question itself is a big concept..Atleast you must have tried something to achieve it..we can help you out with the modules..
for a jump start -
study about touchesBegan:,touchesMoved:,and touchesEnded methods.
Instead of using Gesture Recogniser, try to make your own pinch effect by the above methods..
U'll get much more flexibility to control the touch points.
Hope it helps.. :)

you need to associate a pinch gesture (type of UIPinchGestureRecognizer)with your UIImageView .
Check the below blog tutorial with sample code
Working with UIGesturerecognizer
Sample code from Apple

You can find help here : Limit maximum scale for scaling image with pinch gesture in IOS
Basically, using a gesture, you get a factor that you use to scale your image.

Related

iphone: Hands free gestures

In my iPhone app, I require to recognize the gesture or motion made by the user on the view without touching it.
I want the hand free gestures to be recognized and perform a function on view.
I need that the image should move with the gesture detection.
What needs to be done?
How do I recognize it?
Any directions or tutorials will be really appreciated.
You might want to have a look at OpenCV. There is a good example on how to use OpenCV to recognize a hand here: http://www.andol.info/hci/1661.htm

How to do circular scroll view?

I am doing an application in which i have to show a semi circle on which there should be different options in scroll view. That means on that image of semicircle i have to show scroll in circular way .
How can i do that??
Can anyone please guide me ?
You mean you'd need to rotate the contents inside the semi-circle like in a "wheel of fortune" kind of way?
I don't think you can do that with a regular UIScrollView, you'd have to handle the touches and do the rotation yourself.
I'd recommend you start by taking a look at the "Touches" code sample from the UIKit docs:
http://developer.apple.com/library/ios/#samplecode/Touches/Introduction/Intro.html#//apple_ref/doc/uid/DTS40007435

iPhone "Move and scale"... and rotate?

I am trying to find a way to make some way for users to adjust their images for my app. I tried default "Move and Scale" but it doesn't seem to support rotation.
what I want to do is making users to move, scale, and rotate the picture to fit in the overlay/silhouette. What should I do?
Have a look at the UIGestureRecognizer class available in iOS4. This can be used to detect certain gestures like rotation, panning & pinching. Once the gesture has been detected it's up to you to add the correct transform to the picture for instance.
The gesture recognizers really are the way to go, no more touchesBegan/Ended madness. But they come at a cost, as they are iOS4 only.
Link: UIGestureRecognizer Class Reference
Refer to this code by Erica Sadun - https://github.com/erica/iphone-3.0-cookbook-/tree/master/C08-Gestures/14-Resize%20And%20Rotate/

rotate uiview using touch (ipad and iphone)

I am trying to design another app and am struggling to think of the best way to do it. I'm after some advice please!
If you imaging a bicycle wheel in the middle of the ipad (and iPhone)... I want the user to be able to click on the tyre and spin it to the left or right. Depending on the speed of the swish will drive the speed of the wheel rotation.
It should rotate around the centre of the wheel and not move any other direction.
Do I need to use some graphics code, or simply listen for the touch, check the area they touched, then rotate the image around it's centre left or right?
Really I'm after some pointers around the methods to use - I'm not being lazy and asking for code, but if anyone knows of tutorials - that would help immensely!!
Thanks for any info.
Your best bet is to use one of the UIGestureRecognizer subclasses, probably UIPanGestureRecognizer as it includes velocity.
Apple's SimpleGestureRecognizers project will help you get started.

IPhone two fingers twist gesture

I need to rotate an image when the user do a two finger twist on it.
do you have an idea on how i can code this or if you've done this before.
I think it would be a good idea to write a class that detect all the main gesture and provide iif.
I found this example on the internet. It's very nicely written...
http://www.skylarcantu.com/blog/2009/08/08/multitouchsingletouchtap-handling/
When you rotate your thumb and index clockwise what really happens is that:
the thumb starts on the right
descrives a u shape underneath the index
finishes on the left
If you look at the full gesture it is .) rotated clockwise. In some cases, the index will move slightly south-east so you get /).
I suggest looking into SDK 3.2 - it has extended support for gesture detection.