使用 C# 访问 GIF 帧 [英] Access GIF frames with C#
本文介绍了使用 C# 访问 GIF 帧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是 C# 的初学者.我想知道是否有办法使用 C# 访问 GIF 动画中的不同帧.我使用的是 Visual Studio 2008.
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.
推荐答案
试试这个:
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);
这篇关于使用 C# 访问 GIF 帧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文