views:

66

answers:

2

Hi,

I need in animation of sequence of more PNG files (300 png files and size is 320x480). I've try make it with 12 fps, but sometime iPhone 3g have lags... 3gs working fine. I think 2g working with lags always.

I've use one UIImageView and loading images in NStimer callback by UIImage:imageWithContentOfFile.

May be this is not best way to animation png files ?

note: previously i've used ImageOptim to pack (or strip ??) all my images (from 20% to 80% of size strip).

regards,

A: 

If you can afford some sort of delay when the apps start, you may cache some images (say, storing them in NSMutableArray) before displaying them. This assume the bottleneck is in the imageWithContentOfFile call.

One more option is to keep imaging loading in a NSOperation (thread in its simpler form).

ohho
Yes, i think bottleneck is imageWithContentOfFile.THank you very much i will try both methods.
Sergey
+1  A: 

Using an image view for full-screen animation is really not going to go well, regardless of how you compress your images. Make the frames into a video file and use MPMoviePlayerController.

Noah Witherspoon