Rendering animated GIFs

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi,

I'm trying to display an animated GIF (GIF89a) using GDI. I got it
mostly working.
One of the things, that do not yet work correctly, is the 'disposal
method' field of the Graphic Control Extension block. At the moment, I'm
handling it like this:
0 or 1 - don't remove the current frame and simply draw the next one over it
2 - fill the current frame's rectangle with the GIF's back color; then
draw the next frame over the result
3 - replace the content of the current frame's rectangle with what was
there before the current frame was rendered; then draw the next frame
over the result

Now I have this GIF:
http://www.timosoft-software.de/phpBB2/images/smiles/icon_angry.gif
I would expect it to make use of disposal method 2 or 3, but it uses 0
and 1 only. Around frame 47, this leads to drawing failures, because the
smiley's hands are not removed.

The whole thing is displayed correctly, if I increment the 'disposal
method' fields by 1, thus making them one-based. According to the GIF89a
format specifications, this field is zero-based. So are the format specs
wrong (*lol*) or am I doing something wrong? Has anyone some code that
works for the linked GIF and uses a zero-based 'disposal method' field?

Thanks in advance
Timo
--
www.TimoSoft-Software.de - the home of ExplorerTreeView
Boycott DRM! Boycott HDCP!
.



Relevant Pages

  • Re: Rendering animated GIFs
    ... Disposal Method 0 specifies no recommendation as to the disposal method. ... I'm trying to display an animated GIF using GDI. ... there before the current frame was rendered; ...
    (microsoft.public.win32.programmer.gdi)
  • Reading all frames and information of GIF [solution]
    ... Well, I've been bussy with a gif loader, because I needed all the frames. ... For each frame, the function addFrame(Image image, ... private static final String NODEPATH_HEIGHT = ... int imageHeight = Integer.parseInt(findValueWithPath(streamRoot, ...
    (comp.lang.java.programmer)
  • Re: Timing of animated GIFs
    ... The last frame of my GIF was set to 10 seconds, ... that I could advance the PowerPoint slide with the last part of the GIF ... Fixing PowerPoint Annoyances http://www.oreilly.com/catalog/powerpointannoy/ ... The GIF starts to animate as soon as it hits the screen, ...
    (microsoft.public.powerpoint)
  • Re: MMX speedup for Floyd Steinberg error diffusion
    ... frame. ... Ill try out your approach with palette lists and see how it goes... ... should be calculated in a linear space, otherwise the error diffusion ... OTOH, at the time we start to worry about stuff like this, 8-bit GIF ...
    (comp.lang.asm.x86)
  • SPIN Test release 11 out!
    ... To save a GIF, specify the ".gif" extension when you save the ... There's also the option to "frame advance" whilst paused - pause the ... ULA Snow has been found to be very, very CPU intensive to emulate - it's ... There's also a special kind of contention, ...
    (comp.sys.sinclair)