Click here to Skip to main content
Licence CPOL
First Posted 26 Nov 2008
Views 43,095
Downloads 3,920
Bookmarked 33 times

Multipage TIF Viewer

By | 26 Nov 2008 | Article
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)

About the Author

Matjaž Grahek

Other

Slovenia Slovenia

Member

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.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
SuggestionAn Alternative PinmemberDadajiIn18:00 30 May '12  
GeneralMy vote of 5 Pinmemberjonathan_i_smith23:37 6 Mar '12  
QuestionThanks PinmemberJohnson.Sebastian/35377190:47 8 Oct '11  
Questionabout code redistribution Pinmemberedinson Zuñiga Lourido5:24 9 May '11  
AnswerRe: about code redistribution PinmemberMatjaž Grahek7:45 9 May '11  
GeneralKeep up the good work PinmemberRockingDownTheHighway16:50 9 Feb '11  
GeneralMy vote of 5 PinmemberMember 40692055:30 23 Jul '10  
GeneralI like this. This is what i'm looking for. Thanks PinmemberDAT HAN9:26 23 Apr '10  
GeneralHere's some optimized code for ya.... PinmemberGary Noter12:01 6 Jul '09  
GeneralRe: Here's some optimized code for ya.... PinmemberMatjaž Grahek19:44 6 Jul '09  
NewsMultipage Tiff Viewer Control ASP.NET Pinmembertiffviewer6:27 16 Mar '09  
QuestionHow to use it with SQL image PinmemberAlmatrodi17:56 18 Jan '09  
AnswerRe: How to use it with SQL image PinmemberMatjaž Grahek19:37 18 Jan '09  
GeneralRe: How to use it with SQL image PinmemberAlmatrodi19:35 22 Jan '09  
GeneralASP.NET PinmemberPChott1:59 26 Nov '08  
GeneralRe: ASP.NET PinmemberMatjaž Grahek3:04 26 Nov '08  
Not sure as i havent played that much with ASP.NET, but i think its possible. I tried this code in VB.Net and C# and it worked, but needed just some changes (adoptation to the language libaries).
 
It should work in .NET Envirioment.
 
Regards,
Matjaž

GeneralRe: ASP.NET PinmemberUstesGreenridge1:23 23 Jan '09  
GeneralRe: ASP.NET PinmemberMatjaž Grahek3:24 23 Jan '09  
GeneralRe: ASP.NET Pinmemberdiepkv20:55 8 May '09  

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.

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