Last active
December 18, 2015 21:29
-
-
Save ochilab/5847979 to your computer and use it in GitHub Desktop.
multi-tiff イメージファイルから指定したページを表示する(C#)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using System.Drawing.Imaging; | |
int page = 2; //指定ページ | |
FileStream tifFS = new FileStream(tiffFileName, FileMode.Open, FileAccess.Read); | |
Image gim = Image.FromStream(tifFS); | |
FrameDimension gfd = new FrameDimension(gim.FrameDimensionsList[0]); | |
int allPageNumber = gim.GetFrameCount(gfd);//全体のページ数を得る | |
gim.SelectActiveFrame(gfd, page); | |
Bitmap myBitmap = new Bitmap(gim); | |
pictureBox1.Image = myBitmap; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment