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

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/

Related

iPhone iOS how to create interactive drag, rotate, resize, delete view control?

I got an app that allows users to add content to a canvas. I would like to be able to offer the user an ability to move, rotate, resize, reflect this content. Currently I'm doing this with gestures, but would like to know if there is some sort of open-source widget that draws a box around the view and adds 4 buttons to do these functions:
rotate 90 degrees
rotate freely
resize
delete
Can anyone think of an open source framework that I can add to my project to create controls like the ones displayed?
I can probably build this by hand, but debugging gesture recognizers and view rotation is not the most fun thing, so I'm looking for something more polished.
Thank you!
Here's a link to an open source control on cocoa controls that looks like something you could use: TDResizerView.
"TDResizerView is used to resize and rotate an imageview with single finger"
Sounds like a good place to start from, even if you need to modify it.
I've never used this particular control though, so take my word for what it's worth.
edit: Also keep in mind that on iOS, users generally expect gestures. Forcing them to use the handles instead of pinching or rotating may be bad for your user experience, depending on why you want the handles instead.

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 display photos like iphone homescreen?

I'm trying to make an app that's displaying my photos from camera roll like app icons in iphone (matrix view) . The pictures will have the "wobble" effect and the pictures need to be rearrangeable(the posibility to swap pictures).
I found out how to implement the wobble efect.
What`s the best way to implement the displaying and swapping functionality?
I suggest you to show your photos using CALayer.
Add those layer in Matrix like pattern in your UIView using frame property of layer.
To move or rearrange photos find particular CALayer in touchesBegin method of View using touch points and Move it with movement in touched(in touchesMoved). Settle it in a proper location in touchesEnded method.
I have assumed that you have basic knowledge of usage of classes that I mentioned in above description.
Post here if you need more help.

How to get pinch effect to an image in 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.

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.