views:

347

answers:

2

Hello,

I'm not sure I did understand that very well in the Apple doc. I'm considering using CATiledLayer to display a JPEG image. However, I only have an entire JPEG file at my disposal and no small tiles. Is it still possible to use a CATiledLayer and let it "tile" the JPEG?

Thanks!

A: 

The easier way is to just downscale the image until it fits (I think devices support up to 2044x2044 or so). You can create subimages of a CGImage with CGImageCreateWithImageInRect()

tc.
+1  A: 

No. You will have to tile them yourself, unfortunately. The WWDC 2010 videos on Core Animation discuss how to do this and in their sample code, they demonstrate how to use a CATileLayer when the tiles already exist.

Correction

I meant to say watch the Scroll View session. It's session 104 "Designing Apps with Scroll Views"

Matt Long
Thanks. Actually it's by watching this section that I wondered how it was possible without existing tiles.I want to show an image collection stored as JPEG. Should I tile them at runtime? Should I just not tile them...Does it mean that in the photo app they store tile of the pictures in additions to the picture?
Kamchatka