C#分割多页Tif文件

//分割Tif图片为多个Gif图片
   Image img = Image.FromFile("C:\\1.tif");
   Guid guid = (Guid)img.FrameDimensionsList.GetValue(0);
   FrameDimension dimension = new FrameDimension(guid);
   int totalPage = img.GetFrameCount(dimension);

   this.statusBar1.Text = "共"+totalPage+"页";

   for(int i=0;i<totalPage;i++)
   {
    img.SelectActiveFrame(dimension,i);
                img.Save("C:\\Gif"+i+".gif",System.Drawing.Imaging.ImageFormat.Gif);
   }

你可能感兴趣的:(文件)