Re: Using UIImageView for animations
Re: Using UIImageView for animations
- Subject: Re: Using UIImageView for animations
- From: David Duncan <email@hidden>
- Date: Tue, 13 Jan 2009 10:24:54 -0800
On Jan 12, 2009, at 8:10 PM, Glenn Bloom wrote:
- When I animate a set of PNG's rather than JPEG's (again using
UIImageView's animationImages property), I am thinking I don't need
to
think about compression (or Apple optimization)? Is it then
appropriate to
think of the total memory to be consumed simply as an aggregate of
the total
bytes for all the images?
Basically yes. The rule of thumb is Width * Height * 4 for each image.
Images must be decompressed before display. The PNG optimization that
Xcode applies converts the image to a format that is optimal for
display, it doesn't reduce the amount of storage needed to display it.
- Am I correct in thinking that for loading a short-running
animation, I
should generally use the initWithContentsOfFile method of UIImage
instead of
imageNamed because imageNamed caches the data into memory?
Unless you can prove that you get better performance with +imageNamed:
you should always prefer +imageWithContentsOfFile: or -
initWithContentsOfFile:. This is especially true with large images
(primarily because they consume lots of memory and are not reused
often enough to gain a benefit).
- I had thought there was a way to use Instruments to assess if a
UIImageView animation was skipping frames. Now, I'm not so sure. Any
particular way to test if such an animation is skipping or not
displaying
frames?
You can get an FPS meter from the Core Animation instrument. This may
or may not be what you are thinking of.
--
David Duncan
Apple DTS Animation and Printing
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden