获取 GIF 图片的帧数

using System.Drawing;
using System.Drawing.Imaging;
 
namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        private void button1_Click(object sender, EventArgs e)
        {
            string imgPath = @"d:\test2.gif";
            Bitmap bmp = new Bitmap(imgPath);
            Guid[] guids = bmp.FrameDimensionsList;
            FrameDimension fd = new FrameDimension(guids[0]);
            int frameCount = bmp.GetFrameCount(fd);
        }
}
 

posted on 2012-06-27 12:29  SkySoot  阅读(1456)  评论(0编辑  收藏  举报

导航