views:

458

answers:

2

I need to display some very large images on the iPad. The files are jpgs and are about 6700x2700 (maps). Is there any way around loading the entire image into memory?

Currently I load it int a scroll view for zooming/panning.

The images are stored locally on the device.

+2  A: 

You need to use CATiledLayer to display images of that size. Refer to the CATiledLayer class reference and Core Animation programming guide.

Run Loop
this is exactly what I was looking for but I have never used CALayers and I dont really know where to begin. Do you know of a good online tutorial?
Brodie
There are several if you Google "catiledlayer large images iphone" or similar.
Run Loop
I couldnt find anything that took the perspective of someone who knows nothing about core animation. I'd even be willing to purchase a book about it if someone could reccommend one.
Brodie
http://www.olivetoast.com/blog/2009/08/simple-uiscrollview-catiledlayer-pdf-example/
Run Loop
@Brodie4598 - See also Bill Dudney's sample iPhone CATiledLayer project here: http://bill.dudney.net/roller/objc/entry/tiledlayer_on_the_iphone
Brad Larson
both of the examples use pdfs as the image to display and thats where im getting stuck. I think i've got it mostly figured out except the delegate. I dont knowhow to convert: CGContextConcatCTM(ctx, CGPDFPageGetDrawingTransform(image, layer.bounds, 0, true)); CGContextDrawPDFPage(ctx, image);
Brodie
A: 

Like they said, all you need is something like

+(Class)layerClass
{
    return [CATiledLayer class];
}

in your view.

David Dunham