twitter-archive / twui

A UI framework for Mac based on Core Animation
Other
2.74k stars 268 forks source link

TUIImage for animated gif? #104

Closed devon closed 12 years ago

devon commented 12 years ago

Any idea how to do this? Thank you.

avaidyam commented 12 years ago

Something like this: http://iphonedevelopertips.com/graphics/animated-gif-animated-images-iphone-style.html would help, seeing as both TUIImage and UIImage are just CGImageRef wrappers.

devon commented 12 years ago

Thanks.

I got the each frame fro NSBitmapImageRep *rep = [[_img representations] objectAtIndex:0];

and duration: CGFloat frame_times = [[rep valueForProperty:NSImageCurrentFrameDuration] floatValue];

Use animation to play the gif. It works.

avaidyam commented 12 years ago

Welcome!