Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting the frame duration of an animated GIF?

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?

like image 819
Andy Avatar asked Sep 24 '10 07:09

Andy


1 Answers

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.

like image 84
Denis Palnitsky Avatar answered Sep 19 '22 04:09

Denis Palnitsky