6

In C#, I can get the individual frames from a gif and show the animation easily enough, but how do you go about getting the timing information for each frame?

Andy
  • 2,764
  • 6
  • 24
  • 33

1 Answers1

14
PropertyItem item = img.GetPropertyItem (0x5100); // FrameDelay in libgdiplus
// Time is in milliseconds
delay = (item.Value [0] + item.Value [1] * 256) * 10;

This article may be useful.

Kempeth
  • 1,856
  • 2
  • 22
  • 37
Denis Palnitsky
  • 18,267
  • 14
  • 46
  • 55
  • To clarify: The GIF stores the interval in s/100. The variable `delay` contains the interval in milliseconds. – Kempeth Jan 30 '18 at 07:44