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

xArtx

macrumors 6502a
Original poster
Mar 30, 2012
764
1
Hi,
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?

Code:
    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?
 
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.
 
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.
 
Hi,
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?

Code:
    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?

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.
 
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.
 
Last edited:
It appears to work without any problems.

even some crazy stuff like:

Code:
CGRect imageRect = CGRectMake(-1000, -1000, 3200, 4800);
    [myImage drawInRect:imageRect];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.