• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: gif animation without NSImageView ??
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >gif animation without NSImageView ?? (From: Bob Miller <email@hidden>)

  • Prev by Date: Re: reading postscript file
  • Next by Date: window frame from user defaults trouble
  • Previous by thread: gif animation without NSImageView ??
  • Next by thread: Custom IB palette and menu item
  • Index(es):
    • Date
    • Thread