Redstar
Redstar

Reputation: 15

Huge image I want to manipulate in my Xcode app

I have a huge map image (25mb) that I want to use in my app. The entire point of the app is to pinch zoom and scroll around this richly detailed map.

I am loading it in a uiimageview, with some subview layers that can be toggled on and off to overlay the map.

Everything is working fine code wise and on my simulator, but my concern is that the actual iPhone/iPad may have problems rendering/manipulating a 25mb png image.

Anyone have experience with huge image files in Xcode? Any recommendations or concerns about what I have described?

Someone suggested using uiwebview to display the image. I'm not sure why thy would be any better.

Thanks

Upvotes: 0

Views: 661

Answers (2)

ader
ader

Reputation: 5393

Check out the ADC Videos, specifically WWDC 2010 Session 104 "Designing Apps With Scroll Views". This shows how to use CATiledLayer.

Upvotes: 2

Alexander
Alexander

Reputation: 8147

Best way to handle very large images is to chop them into easily manageable square chunks and load them dynamically. Here you can see a very nice tutorial for a tiled UIScrollView. Modding the code a bit will surely suit your needs.

Upvotes: 3

Related Questions