Access GIF frames with C#

后端 未结 2 1988
再見小時候
再見小時候 2020-12-10 03:09

I\'m a beginner in C#. I would like to know if there\'s a way to access different frames inside a GIF animation with C#. I\'m using Visual Studio 2008.

相关标签:
2条回答
  • 2020-12-10 03:37

    Try this:

    using System.Drawing;    
    using System.Drawing.Imaging;
    
    Image gifImg = Image.FromFile(pathToGifFile);
    FrameDimension dimension = new FrameDimension(gifImg.FrameDimensionsList[0]);
    // Number of frames
    int frameCount = gifImg.GetFrameCount(dimension);
    // Return an Image at a certain index
    gifImg.SelectActiveFrame(dimension, index);
    
    0 讨论(0)
  • 2020-12-10 03:57

    a bit of googling: editing animated gif's in c#

    You can read the animated Gif with Image.GetFrameCount() and SelectActiveFrame().

    0 讨论(0)
提交回复
热议问题