C#读取分割多页Tif文件
//分割Tif图片为多个Gif图片
1 Image img = Image.FromFile("C:\\1.tif");
2 Guid guid = (Guid)img.FrameDimensionsList.GetValue(0);
3 FrameDimension dimension = new FrameDimension(guid);
4 int totalPage = img.GetFrameCount(dimension);
5
6 this.statusBar1.Text = "共"+totalPage+"页";
7
8 for(int i=0;i<totalPage;i++)
9 {
10 img.SelectActiveFrame(dimension,i);
11 img.Save("C:\\Gif"+i+".gif",System.Drawing.Imaging.ImageFormat.Gif);
12 }
13