zoom a specific part of image in UIImageview

Discussion in 'iOS Programming' started by xcodelearner, Oct 9, 2010.

  1. xcodelearner macrumors newbie

    Joined:
    Oct 9, 2010
    #1
    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.
     
  2. xcodelearner thread starter macrumors newbie

    Joined:
    Oct 9, 2010
    #2
    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
     
  3. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #3
    Obvious answer: put the UIImageView inside a UIScrollView
     
  4. xcodelearner thread starter macrumors newbie

    Joined:
    Oct 9, 2010
    #4
    I want the image to be on Interface builder, is it possible with a scroll view???


    I want the image to be on Interface builder, is it possible with a scroll view???
     
  5. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #5
    This does not make any sense.
     
  6. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #6
    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.
     
  7. fypj2013 macrumors newbie

    Joined:
    Mar 12, 2013
    #7
    Zooming image to specific point

    hi xcodelearner,

    do u mind sharing the code of zooming into a specific part using uiscrollview?:D
     
  8. xArtx macrumors 6502a

    Joined:
    Mar 30, 2012
    #8
    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.
     
  9. Duncan C macrumors 6502a

    Duncan C

    Joined:
    Jan 21, 2008
    Location:
    Northern Virginia
    #9
    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.)
     
  10. xArtx macrumors 6502a

    Joined:
    Mar 30, 2012
    #10
    Ok, I know how to tile 2D images, but now I will have to check it out.
     

Share This Page