使用C#访问GIF帧 [英] Access GIF frames with C#

查看:158
本文介绍了使用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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆