开发者

Fastest image drawing method on iPhone

I am trying to draw images to the iphone screen by changing the images of a UIImageView in a loop. But since there was no much response on the screen than two or three images being drawn and skipping others I nee开发者_开发百科d another method.

I am trying to show 80 png images that are 320*480 in size at 30 images per second.

Please suggest the fastest method to do this. And some sample code if available.

Thanks


Well, keeping 80 images of that size in memory will use roughly 50 MB of memory. Do you have that kind of memory available on the device?


Some context would be helpful. Why do you need to display the images so quickly, and do they have to be PNG and do they have to be separate?

By far the fastest way to draw successive images to the screen is by putting them into a movie file. This allows you to use frameworks specifically designed for drawing frames to the screen in the fastest possible manner.

Check out Apple's documentation on how to play video files in your app: Using Video in iPhone OS.

If you relax the quality of your images you might see a performance gain. Try using less color depth for sure. Remember that you are testing your app in the ideal scenario, nothing else it taking up very much processor time. But on a real world iPhone, the user could be doing any number of things.


The fastest drawing method on the iPhone is OpenGL ES. :) If you make some texture atlases with your images you'll achieve what you want.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜