0

I just crashed against the fact that cramming 60 960x640 PNG files into an UIImageView is a terrible mistake.

That said, I'm still required to show this animation, and since it's supposed to have a transparent background, I can't go for a MPMoviePlayer or something like that (or can I?). Besides, even if I could separate the different elements of the animation (which I can't without going to the guy who gave it to me) most of them are still quite large.

I'm at a complete loss for ideas. Do you have any?

Morpheu5
  • 2,610
  • 6
  • 39
  • 72

1 Answers1

0

Sounds like you might be better suited playing a video, but I'm not sure about the transparent background. Using separate pngs, you have to load each one into memory, which is (640 * 960) pixels * 24 bits/pixels * 60 images = a lot of memory.

That said, how fast do you need to play the animation? Instead of using UIImageView animations, you could use a timer and manually manage loading and unloading of the images into memory, only keeping around one or two at a time.

Zev Eisenberg
  • 8,080
  • 5
  • 38
  • 82
  • Yes, I thought of doing so, but I still have to try because the client incredibly accepted the fact that a video would have been better and sent me a revised version with a white background which I now have to fade in and out before and after playing the video. Anyway, I'll accept your answer because it makes sense :) – Morpheu5 Mar 12 '13 at 17:15
  • For the correct approach, see my answer to this question: http://stackoverflow.com/questions/8112698/how-to-do-animations-using-images-efficiently-in-ios/8113027#8113027 – MoDJ Nov 28 '14 at 09:14