Reputation: 7219
Right now I am loading a large number of images when the application launches. Is there an easy way to determine the maximum total size of images capable of being loaded on any given device?
Upvotes: 0
Views: 902
Reputation: 33592
I'm assuming you mean "maximum size of a single image".
From UIView class reference:
Note: Prior to iPhone OS 3.0, UIView instances may have a maximum height and width of 1024 x 1024. In iPhone OS 3.0 and later, views are no longer restricted to this maximum size but are still limited by the amount of memory they consume. Therefore, it is in your best interests to keep view sizes as small as possible. Regardless of which version of iPhone OS is running, you should consider using a CATiledLayer object if you need to create views larger than 1024 x 1024 in size.
In my testing, it seems to be a limitation of the graphics hardware: iPhone 3G has a texture size limited to 2044×2044 or so; presumably the original iPhone and iPod are similar. This is only for images drawn to the screen — you can use CGBitmapContextCreate()/UIGraphicsBeginImageContext() and render larger images to it, and then render the downscaled image to the screen.
In general, it's silly to render a huge image to the screen. It'll be redrawn (loosely) every time the display refreshes, which means you end up with terrible scrolling performance.
Upvotes: 1