How to handle image manipulation in IPad - objective-c

I want to be able to place images in an iPad app from a given directory and then let the user resize the image and move it around on the screen.
My question is: what's the best view to use that would allow user to resize the image (with gesture recognition) and move it around on the screen?
Thanks in advance

Quartz 2D
http://developer.apple.com/library/ios/#documentation/graphicsimaging/conceptual/drawingwithquartz2d/dq_overview/dq_overview.html#//apple_ref/doc/uid/TP30001066-CH202-TPXREF101
Can draw anything you want.
Control with gestures

You're looking for UIScrollView with the viewForZoomingInScrollView: delegate method implemented.
Since you want to display an image, add a UIImageView to the scrollview and return it in the delegate.

Related

Magnify image on tap or Long press gesture

I want to magnify image on LongPress gesture. i have one scrollview inside that one container view and inside that one ImageView. i want magnify on ImageView. i research a lot but not finding anything helpful.
Is there any third party api is available?
Thanks

Facebook App Style UIImageView

I have bunch of images inside a UIScrollView and have a tap event setup on each image. When I try to make the image full screen it actually is cut off by the scroll view. I am trying to implement a Facebook style UIImageView where the image zoom in and takes over the full screen on tap.
Does anyone have suggestion on how to approach this cause the way I am doing the image is cropped to the size of the scroll view.
Well, usually you would disable clipping, but the scrollview relies on clipping to do its job so that won't work.
My suggestion would be to push a copy of the image above the scrollview, and animate that to full screen. You should be able to get the rect using convertRect:toView: and it would be pretty straightforward from there.
btw, Is there a reason not to use a tableView for this?
When tapped hide the image and add the image at the proper place in the scrollview superview and over the scrollview. Then animate it to take the full screen.
Facebook App style UIImageView is nicely implemented in below given source code, you can take a clue from this
https://github.com/michaelhenry/MHFacebookImageViewer

How to move this ColorPicker from iPhone to a portion of iPad scene?

I found a ColorPicker (ILColorPicker) that takes the whole screen on an iPhone. I want to use it in my iPad app (XCode4 using StoryBoards)... it's asking me to "In your view controller's XIB, add a UIView and then set it's class to ILColorPickerView ". I don't want to use the entire scene, just a small part of it... is there another way I can accomplish this? (using Layers, frames, etc)?
You could programmatically create a popover (UIPopoverViewController), and put the color picker as the view for your popover.

animated sprite images in navigation bar buttons

Working on an iOS app right now - was curious to if it is possible to use an animated sprite for a button in the Top Nav Bar. For example, having the hands on a clock button continually turn via a looped animation (like a web GIF - but better). Is this possible, and if so, how difficult is it?
Thanks!
Zach
Check out the animatedImageNamed:duration: and animatedImageWithImages:duration: methods of UIImage. You will have to put each frame of each sprite in a separate file, or (if you don't want to split up your animated GIF) use the ImageIO framework to create separate UIImage objects for each frame in the GIF.

Laggy UIScrollView

At the moment I'm working on an iPad explore game which has a hexagon tile map.
I've created a UIScrollView that contains a background view (the game map) and buttons in the form of hexagons (for interaction). I add every UIButton to the view via addSubview.
But... when I add more than 100 buttons the view gets laggy (no surprise here). But what should I do to solve this?
Example:
scroll view http://img233.imageshack.us/img233/5527/screenshot2011090110353.png
Adding UIButtons isn't the way to go here. You should probably draw the "buttons" in a custom -drawRect: method and use -touchesEnded:withEvent: to decide what the user wanted to do.