Re: gif animation without NSImageView ??
Re: gif animation without NSImageView ??
- Subject: Re: gif animation without NSImageView ??
- From: Troy Stephens <email@hidden>
- Date: Wed, 28 Jan 2004 15:20:38 -0800
On Jan 28, 2004, at 9:28 AM, Bob Miller wrote:
Does anyone know if it is possible to 'run' an animated gif without
the need for an NSImageView to contain it ? Or in the least be able to
test the gif image data to see if it contains animations or a single
frame ?
Yes. Once you've got the .gif loaded as an NSImage, search the NSImage
for an NSBitmapImageRep, then refer to the animated GIF properties
listed in the NSBitmapImageRep docs:
http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/ObjC_classic/Classes/NSBitmapImageRep.html#//apple_ref/
occ/cl/NSBitmapImageRep
NSImageFrameCount tells you how many frames there are in the animation.
NSImageLoop count tells you whether the animation should be looped,
and, if so, how many times. Set NSImageCurrentFrame to the index of a
desired frame to cause it to be the frame you get when you next draw
the image. Add an NSTimer to the mix and you're ready to animate! :-)
(NSImageCurrentFrameDuration tells you how long the current frame
should be displayed.)
Troy Stephens
Cocoa frameworks, Apple
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.