zooming in on image, showing more details - iphone

I am working on a little project and want to implement some sort of "google maps" zooming. What I mean with that is that I want to show an image, and let the user be able to zoom in into a bit of the picture.
The first image should show an overall view of an airport, with its terminals and gates ect. But when zooming in on a terminal it should show more details on where bus stops, taxi stops, info, café's ect are located. It should NOT be a map.
I have searched Google a bit, but couldn't really find anything. Anyone who has any suggestions? Preferable links to tutorials for similar things?
Best regards,
Paul Peelen

The standard way to implement this is by using a UIScrollView and within the UIScrollView add a custom UIView with CATiledLayer layers. You will render the image by drawing (setting content) to the inner CATiledLayer layers. Look at the PhotoScroller sample project.

Related

Using PageControl?

I have an array and lets say I have 5 objects in it. The array just contains a string with an address to a picture. I would like to use the Page Control feature in the iPhone SDK to swipe Left and Right to change the picture. I already have the multitouch gestures in place all I need is to implement the Page Control so if I swipe left and then right it will take me back to the previous image.
Does anyone know of any good Page Control tutorials or sample code online that may be able to help me thought implementing the Page Control.
The UIPageControl isn't a control as much as it's just an indication of what "page" your on.
To do what you want, you need to set up a UIScrollView and add subviews for each image. It will require some math to figure out where each "page" starts and ends based on image dimensions and screen sizes.
Apple has some docs on using scroll views with page controls here.
Indeed, you need a UIScrollView along with the UIPageControl. You can find a good tutorial on how to make them work together here

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 save a image larger then in the phone

I made an app following these instructions
http://www.ifans.com/forums/showthread.php?t=132024
And was great, but now,
Now, I want to draw in another view at the same time (when the move begin, the line has to be drawn in both views), but different size (without scaling the one i'm touching)
is that possible?
thank you
I would draw with OpenGL instead in that case, as you can add a larger view, and a camera which scrolls based on what the users actions are. You can find a great sample project to do this here. In order to find more stuff about the camera, and making a larger view, you can look here, or search in google for OpenGL iPhone tutorials. Hope that helps!

Zooming a hotspot when it clicked

I have to make some hot spots on my image , so that when i click anyone of them they zoom.
For example consider the image
When i click that butterfly then it zoom
Please provide a good solution
Following are my thinking
Use a button and click it and add a subImageView and zoom it.
Zoom a particular region of this image when touch at that place.
Both ideas have their limitations.In first i have to create a saperate image and also my app size will become very large.
and limitation of second is that it will not zoom exact required image.
I was also thinking of masking but i think that is also not very good way, because this is just a sample, i have many images like this and can be many hot spots on a single image.
please guide.
If you are dealing we rather large images you should check out CATiledLayer, which are very fast and efficient to use.
Check out this blog post, including the demo app:
http://www.cimgf.com/2011/03/01/subduing-catiledlayer/

switching images with animation

I'd like to have a static background image (let's imagine a model in underwear), where several images are placed in layers in front of the background. Each image in front can be switched out, from the left or right, with some animation.
So our model might start with a panama hat on her head. A gesture replaces it with a porkpie hat, another gesture places a toque. A dress on her body switches to a pant suit, then mechanic overalls. Cowboy boots to sandals to galoshes, and etc.
It seems there are many ways to do this. I could use UIScrollView, with paging enabled. There is Core Animation, with CALayers on top of the background image. Even simple UIImageViews with swipe gestures enabled, tracking coordinates of the user's finger.
Does one of these techniques stand out as being better than the others in this case? Or does it seem to you readers that each could work as well as the others?
I'd say if you want a prebuild solution try OpenFlow (I'm not affiliated, just a user)
http://apparentlogic.com/openflow/
Otherwise, maybe just a UIScrollView with paging enabled would do the trick?