5
在C#中,我可以從gif中獲取單個幀並輕鬆地顯示動畫,但是如何獲取每幀的時間信息?獲取動畫GIF的幀持續時間?
在C#中,我可以從gif中獲取單個幀並輕鬆地顯示動畫,但是如何獲取每幀的時間信息?獲取動畫GIF的幀持續時間?
PropertyItem item = img.GetPropertyItem (0x5100); // FrameDelay in libgdiplus
// Time is in milliseconds
delay = (item.Value [0] + item.Value [1] * 256) * 10;
This本文可能有用。
澄清:GIF以s/100存儲間隔。變量'delay'包含以毫秒爲單位的時間間隔。 – Kempeth 2018-01-30 07:44:59