1024x1024 UIUImage limit

Discussion in 'iOS Programming' started by xArtx, Mar 7, 2013.

  1. xArtx macrumors 6502a

    Mar 30, 2012
    Apple recommend you load images no larger than 1024x1024 dimensions.

    Since you can't look into image data once it is loaded into a UIImage,
    what is the regular way to zoom in?

        CGRect imageRect = CGRectMake(0, 0, 320, 480);
        [myImage drawInRect:imageRect];
    This code should stretch whatever size image to fit the screen of an iPhone 4/4S.

    What if you wanted to zoom in so far that one pixel took up the whole screen?

    Is it acceptable to draw off screen so far that only one pixel took the whole screen by making the rectangle huge?
  2. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
    You're asking questions without giving any context.

    The usual way to zoom into an image is with an image view and a scroll view. Not sure why you would want to do it any other way.

    Zooming in very far is usually pointless. For most purposes 2x is a lot. One pixel the size of the screen is probably pointless.
  3. xArtx thread starter macrumors 6502a

    Mar 30, 2012
    The current context will do :D

    Zooming into sat imagery where high zoom level data is not available, so the program does it's best with an image tile of lower zoom level.

    The 1, 4, 16, or however many pixels should still show the colour of vegetation.

    information that I think is redundant,
    but there you go....

    Yes I'm trying to cheat out of tiling a raster map,
    And georeferencing every tile, etc.
  4. Duncan C macrumors 6502a

    Duncan C

    Jan 21, 2008
    Northern Virginia
    You're supposed to break images that are larger than that into tiles, and set up a tiling system to load the different tiles as needed. I remember seeing Apple demo apps that show how to do this. Doing a little digging, I think it was in the ScrollViewSuite set of sample apps. The third one shows how to do image tiling.

    It looks like there's another demo app called PhotoScroller that does the same sort of thing using CATiledLayers. I recommend looking at PhotoScroller.
  5. xArtx, Mar 7, 2013
    Last edited: Mar 7, 2013

    xArtx thread starter macrumors 6502a

    Mar 30, 2012
    That wouldn't be hard.
    Once the image is split into tiles,
    Georeferencing them is.

    The images are not larger than 1024x1024.
    I'm asking about displaying them larger on the device by
    stretching them off screen.
  6. xArtx thread starter macrumors 6502a

    Mar 30, 2012
    It appears to work without any problems.

    even some crazy stuff like:

    CGRect imageRect = CGRectMake(-1000, -1000, 3200, 4800);
        [myImage drawInRect:imageRect];

Share This Page