Click here to Skip to main content
11,430,109 members (74,453 online)
Click here to Skip to main content

Multipage TIF Viewer

, 26 Nov 2008 CPOL
Rate this:
Please Sign up or sign in to vote.
A simple and useful viewer of multipage TIF/TIFF images

Introduction

Hi. This is my first article, so it's not so well written, but I hope you'll get the point.

I'll try to show you how to create a simple multipage TIFF, TIF document. It's a sample, so you can edit it by your own wishes and it's functionality can be upgraded endlessly. To give this code a tryout - download the example application and use the example TIFF that's in the folder (it's a US Patent *.tiff file).

So, let's get to the point. You have multipage TIFFs and you can't afford expensive, but useful libraries. Well, this might be just the thing for you. In this sample, you'll meet a few lines of code from GUI+ on how to open and navigate through pages of a multipage TIFF document. And I should not forget to add - the sample includes opening the file, showing it in a picturebox and it has two buttons for navigation (next page, previous page) - but this can be changed on a textbox for realtime change.

Using the Code

The code is quite simple to understand. You use System.Drawing and two Image objects. The code in the sample is well commented so I think you'll understand what's meant by what.

Here is the most important part of the code which operates the whole thing. Everything else is in the sample.

// going to the selected page
myImg.SelectActiveFrame(System.Drawing.Imaging.FrameDimension.Page,int); 

// setting the new page as an image	
myBmp = new Bitmap(myImg,pictureBox1.Width,pictureBox1.Height); 	

Points of Interest

You can check the page navigation buttons, on how they change the current page integer. The loaded document starts with 0. The GUI+ is great.

Conclusion

As this is my first article, I think I shouldn't be judged that much on the spelling, the explanations and the help I'll give as feedback to your questions/remarks/..., which are more than welcome. And please, if you have created any great applications, based on this article - post them here and let us have a look. The last thing I'd like to add is - I'm more a rookie with C# than a senior or an expert which means I've got a lot to learn. I hope you enjoyed this sample and this article.

History

Nothing new, but I think a lot of things should be added in the future... but like I said - it's just a sample to get started.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Matjaž Grahek
Other
Slovenia Slovenia
I'm trying to learn C# and i'm taking this slowly. Anyway, i like creating my own applications and my own solutions, thats why i like programming.

Comments and Discussions

 
QuestionCan't read a tif file generated by Win2008 server 64bit Pin
gaowangzhong11-Mar-15 18:43
membergaowangzhong11-Mar-15 18:43 
QuestionReg the Multipage TIFF Viewer Pin
Member 1133601726-Dec-14 1:44
memberMember 1133601726-Dec-14 1:44 
GeneralMy vote of 4 Pin
cws2_na22-Feb-13 3:56
membercws2_na22-Feb-13 3:56 
GeneralMy vote of 5 Pin
aalhanane7-Nov-12 6:47
memberaalhanane7-Nov-12 6:47 
SuggestionAn Alternative Pin
DadajiIn30-May-12 19:00
memberDadajiIn30-May-12 19:00 
GeneralRe: An Alternative Pin
Matjaž Grahek7-Jan-14 4:49
memberMatjaž Grahek7-Jan-14 4:49 
GeneralMy vote of 5 Pin
jonathan_i_smith7-Mar-12 0:37
memberjonathan_i_smith7-Mar-12 0:37 
QuestionThanks Pin
Johnson.Sebastian/35377198-Oct-11 1:47
memberJohnson.Sebastian/35377198-Oct-11 1:47 
Questionabout code redistribution Pin
edinson Zuñiga Lourido9-May-11 6:24
memberedinson Zuñiga Lourido9-May-11 6:24 
AnswerRe: about code redistribution Pin
Matjaž Grahek9-May-11 8:45
memberMatjaž Grahek9-May-11 8:45 
GeneralKeep up the good work Pin
RockingDownTheHighway9-Feb-11 17:50
memberRockingDownTheHighway9-Feb-11 17:50 
GeneralMy vote of 5 Pin
Member 406920523-Jul-10 6:30
memberMember 406920523-Jul-10 6:30 
GeneralI like this. This is what i'm looking for. Thanks Pin
DAT HAN23-Apr-10 10:26
memberDAT HAN23-Apr-10 10:26 
GeneralHere's some optimized code for ya.... Pin
Gary Noter6-Jul-09 13:01
memberGary Noter6-Jul-09 13:01 
GeneralRe: Here's some optimized code for ya.... Pin
Matjaž Grahek6-Jul-09 20:44
memberMatjaž Grahek6-Jul-09 20:44 
NewsMultipage Tiff Viewer Control ASP.NET Pin
tiffviewer16-Mar-09 7:27
membertiffviewer16-Mar-09 7:27 
QuestionHow to use it with SQL image Pin
Almatrodi18-Jan-09 18:56
memberAlmatrodi18-Jan-09 18:56 
AnswerRe: How to use it with SQL image Pin
Matjaž Grahek18-Jan-09 20:37
memberMatjaž Grahek18-Jan-09 20:37 
GeneralRe: How to use it with SQL image Pin
Almatrodi22-Jan-09 20:35
memberAlmatrodi22-Jan-09 20:35 
GeneralASP.NET Pin
PChott26-Nov-08 2:59
memberPChott26-Nov-08 2:59 
GeneralRe: ASP.NET Pin
Matjaž Grahek26-Nov-08 4:04
memberMatjaž Grahek26-Nov-08 4:04 
GeneralRe: ASP.NET Pin
UstesGreenridge23-Jan-09 2:23
memberUstesGreenridge23-Jan-09 2:23 
GeneralRe: ASP.NET Pin
Matjaž Grahek23-Jan-09 4:24
memberMatjaž Grahek23-Jan-09 4:24 
GeneralRe: ASP.NET Pin
diepkv8-May-09 21:55
memberdiepkv8-May-09 21:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150428.2 | Last Updated 26 Nov 2008
Article Copyright 2008 by Matjaž Grahek
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid