Animated GIF decoder library

agraham

Expert
Licensed User
Longtime User
This library allows you to extract the images from an animated GIF to let you animate them on a device (or desktop) in a Image control using a Timer.

This library does not have high performance on the device but it is probably adequate for most uses.

There is an animation demo in the archive together with the dll, a help file and the source for merging.

EDIT: - Updated to version 1.1 having identified some bugs in the original source code. See post #6 for details

EDIT: - Updated to version 1.2 having better performance. See post #8 for details.
 

Attachments

  • GifDecoder1.2.zip
    34.6 KB · Views: 235
Last edited:

SarahWard

Banned
excellent, Andrew!

Just what I need. Thank you. I was looking at using Sprites to display GIF animations but this is much better.

Sarah
 

susu

Well-Known Member
Licensed User
Longtime User
Thank you so much! :sign0087:
 

agraham

Expert
Licensed User
Longtime User
Version 1.1 now posted.

With the dawn of a new day I took a fresh look at the handling of transparency as I didn't like the need for special treatment of such GIFs. Poking around deeper in the original source code I found several bugs that my special provisions worked around. Having fixed them there is no longer any need for UsesTransparency and UsesPartialFrames so these are removed from version 1.1.

If you find, or make, any GIFs that don't render correctly then please post them.
 

SarahWard

Banned
Version 1.1 now posted.

With the dawn of a new day I took a fresh look at the handling of transparency as I didn't like the need for special treatment of such GIFs. Poking around deeper in the original source code I found several bugs that my special provisions worked around. Having fixed them there is no longer any need for UsesTransparency and UsesPartialFrames so these are removed from version 1.1.

If you find, or make, any GIFs that don't render correctly then please post them.
Wow! Great. That means I don't have to understand all that transparency rendering stuff. :)

As I said, you are quite amazing. :)
 

agraham

Expert
Licensed User
Longtime User
Version 1.2 now posted. While looking at the transparency issues I got more acquainted with what was happening and found the image generation was quite inefficiently coded so I improved it and this version should decode GIFs noticeably faster than before.

As I said, you are quite amazing. :)
Thanks for the compliment, but I'm really not. Just a bit better than average at some things and worse at others. I try to make sure that people only get to see the better bits! :cool:
 

camolas

Member
Licensed User
Longtime User
Hi, agraham's i have a big doubt i did not got it how you do the other frames and were they are saved im very :sign0104: at this...
 

agraham

Expert
Licensed User
Longtime User
The FrameCount property returns the number of frames in the GIF and you can get each one as a bitmap with the Frame(index) method.


' Load a Gif and get the last frame
GifDecoderName.New1
GifDecoderName.Load(AppPath & "\SomeGifName.gif")
Image1.Value = GifDecoderName.Frame(GifDecoderName.FrameCount - 1)
 

camolas

Member
Licensed User
Longtime User
Hi,

I still dont get how you do it :sign0104: :sign0013: how you design several frames images and put it in a single gif for the program to animate it?

Thankz
 
Last edited:

mjcoon

Well-Known Member
Licensed User
... how you design several frames images and put it in a single gif for the program to animate it?

Not with the DeCoder library because that doesn't do encoding! But there are (freebie?) programs to do the encoding to make animated GIFs.

Mike.
 

camolas

Member
Licensed User
Longtime User
Hi,

Can any one point me the way off make an endless animation, that's when you get back to the last frame starts all over again.

Thanks
 
Top