Last active
June 19, 2019 23:59
-
-
Save ochilab/5655370 to your computer and use it in GitHub Desktop.
C#でマルチページ形式のTiff画像を表示する方法(Form編)
This file contains hidden or 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
private void showMultiTiff(string tiffFileName){ | |
FileStream tifFS = new FileStream( tiffFileName , FileMode.Open , FileAccess.Read ) ; | |
Image gim = Image.FromStream( tifFS ) ; | |
FrameDimension gfd = new FrameDimension(gim.FrameDimensionsList[0]); | |
int pageCount = gim.GetFrameCount( gfd ) ;//全体のページ数を得る | |
System.Diagnostics.Debug.WriteLine(pageCount); | |
Graphics g = pictureBox1.CreateGraphics(); | |
for(int i=0;i<pageCount;i++){ | |
gim.SelectActiveFrame(gfd, i); | |
g.DrawImage(gim, 0,0, pictureBox1.Width, pictureBox1.Height);//PictureBoxに表示してます | |
System.Threading.Thread.Sleep(500); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment