views:

163

answers:

1

This is brought on by a previous question. Apparently ImageList doesn't support animated GIFs, so I'm stuck animating it myself.

I know how to extract the frames, but does anyone know how to extract the frame timing information from an animated GIF?

+1  A: 

You can get the duration of the current frame (having called SelectActiveFrame), using a call to Image.GetPropertyItem, as such:

var duration = image.GetPropertyItem(0x5100).Value;

I believe the duration value is measured in 1/100ths of seconds.

Noldorin
Excellent. Now that I look a little harder (specifically for image propertyitem), I find a list at http://www.bobpowell.net/discoverproperties.htm but I was *not* going to find this one easily. Thanks!
lc
No problem. Also, that's a good resource you've found there; I would have linked you to a list of all the property codes for animated GIFs, but I couldn't find one at the time.
Noldorin