Reputation: 3108
So I have a massive UIImage, maybe 10,000x10,000 px (I know they're not supposed to exceed 1024x1024 apparently, but anyway that's not the main problem). Moving this around the screen (constantly drawing at different points using -drawAtPoint) is very slow.
So I split the image into 100x100 px UIImages, and decided to draw them all separately using drawAtPoint. The result was even worse.
Is there a more efficient way of drawing UIImages to screen like this? Or a more efficient method of managing the images? Thanks.
EDIT.. When I broke it into tiles I was only drawing the tiles that were in view.
Upvotes: 0
Views: 376
Reputation: 41682
Apple has this really nice sample code called PhotoScroller - it shows how to use CATiledLayers along with pre-tiled images. But, you have to create the hundreds of tiles before hand, and either include them in your app bundle or download each.
There is another project on github called PhotoScrollerNetwork that has the ability to download massive jpeg only images and do all the various tiling for you, as it downloads. It leverages another open source library, libjpegturbo.
Upvotes: 2