• 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: Animated GIF
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Animated GIF


  • Subject: Re: Animated GIF
  • From: Jens Bauer <email@hidden>
  • Date: Mon, 23 Feb 2004 00:20:52 +0100

Hi Sam,

On Sunday, Feb 22, 2004, at 23:43 Europe/Copenhagen, Sam McCandlish wrote:

Is there a way to make an animated gif in Cocoa? If possible can you make it using an NSImage?

Searching this archive (recent), I found this by Troy Stephens:

---8<-----8<-----8<-----
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.)
--->8----->8----->8-----


Love,
Jens
_______________________________________________
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.

  • Follow-Ups:
    • Re: Animated GIF
      • From: Sam McCandlish <email@hidden>
References: 
 >Animated GIF (From: Sam McCandlish <email@hidden>)

  • Prev by Date: Re: Stealing Font Panel
  • Next by Date: Re: Speed comparison: compare:, methodForSelector: & CFNumberCompare()
  • Previous by thread: Animated GIF
  • Next by thread: Re: Animated GIF
  • Index(es):
    • Date
    • Thread