Gif decompression and display code for ppc and pc
I have many times put some animation in a dialog to add a bit of flare. Unfortunately there is no easy way to do this. It seemed desirable to me to be able to use standard gif files as the source of the animation. There is no way to do this on a windows mobile device using the api provided. On the pc side I had found a few hacks out there that could get a good enough result, but they could not be done on a ppc.
I have made a class that can scan a gif for its parts, decompress the frames within, load them into memory and then animate them onto any window of my choice.
All the features described in the gif standard that relate to the image are supported. I do not process the comment sections of the gif because nobody ever uses them. I handle frame time intervals, transparency, disposal methods and animation. I also add the ability to increase the size by multiples and to alter the base unit of time (the gif standard uses 0.001 second intervals).
The class can have multiple objects instantiated and animate multiple gifs simultaneously. Non animated gifs can also be displayed or animated gifs can be displayed without the animation if desired.
I have produced two demo projects, one for windows mobile and one for the desktop. Download them below.