Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

xcodelearner

macrumors newbie
Original poster
Oct 9, 2010
3
0
I have image in UIImageView and a grid over it. I want to zoom an area of the image on which small grid is there. Please help.
 

xcodelearner

macrumors newbie
Original poster
Oct 9, 2010
3
0
How to Zoom a part of image in image view

Hi I am working on a project in which i have to select a part a of a image and zoom it to occupy the entire screen. I am using UIImage view for this.
I know how to do it with a scroll view, but I am not able to ge any help with image view. Please help
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
If you display a small image in a large imageView then the image will be scaled up, or zoomed in. I guess this is what you're looking for. Does the user need to be able to scroll around in the zoomed image or just view the zoomed image? If they need to be able to scroll then you need a scrollview. If they just need to be able to view the zoomed image then you just need an imageview and a small image that's part of the larger image.

If the grid and image are fixed in position then you should be able to generate the smaller images from the larger images in advance, and even view them in IB. Otherwise you might need to chop up your larger image at runtime.
 

fypj2013

macrumors newbie
Mar 12, 2013
6
0
Zooming image to specific point

hi xcodelearner,

do u mind sharing the code of zooming into a specific part using uiscrollview?:D
 

xArtx

macrumors 6502a
Mar 30, 2012
764
1
Otherwise you might need to chop up your larger image at runtime.
Are you sure that can be done?

There is still an issue with putting them back together.
If they are zoomed in, the interpolation doesn't take pixels of adjacent tiles
into account, and you can see a seam.
Might not matter if you split the image exactly where the grid is.
 

Duncan C

macrumors 6502a
Jan 21, 2008
853
0
Northern Virginia
Are you sure that can be done?

There is still an issue with putting them back together.
If they are zoomed in, the interpolation doesn't take pixels of adjacent tiles
into account, and you can see a seam.
Might not matter if you split the image exactly where the grid is.

Do a search in Xcode on PhotoScroller. It's a sample app that sounds like it does exactly what you want. It uses Core Animation tiled layers to display large images in tiles of 256x256 pixel tiles at several zoom levels, and smoothly handle zooming in and out, scrolling, etc. Very slick little app, and it runs seamlessly. (literally and figuratively.)
 

xArtx

macrumors 6502a
Mar 30, 2012
764
1
Do a search in Xcode on PhotoScroller. It's a sample app that sounds like it does exactly what you want. It uses Core Animation tiled layers to display large images in tiles of 256x256 pixel tiles at several zoom levels, and smoothly handle zooming in and out, scrolling, etc. Very slick little app, and it runs seamlessly. (literally and figuratively.)

Ok, I know how to tile 2D images, but now I will have to check it out.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.