views:

345

answers:

2

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 need 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

A: 

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?

St3fan
A: 

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.

James
I think the information that I provided was misleading. I just wanted a code that can draw images fast to the iphone screen. instead of suppying images to a UIImageView and waiting for it to draw, something like drawing myself to the UIView itself
Nikhil