Click here to Skip to main content
5,788,961 members and growing! (21,101 online)
Email Password   helpLost your password?
Languages » C# » Samples     Beginner License: The Code Project Open License (CPOL)

Multipage TIF Viewer

By Matjaž Grahek

A simple and useful viewer of multipage TIF/TIFF images
C# 2.0, C# 3.0, C#Windows, WinXP, Win2003, WinForms, Win32, Win64, GDI, GDI+, VS.NET2002, VS.NET2003, VS2005, Visual Studio, VS2008, Dev

Posted: 26 Nov 2008
Updated: 26 Nov 2008
Views: 3,000
Bookmarked: 10 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
3 votes for this Article.
Popularity: 2.11 Rating: 4.43 out of 5
0 votes, 0.0%
1
0 votes, 0.0%
2
0 votes, 0.0%
3
1 vote, 33.3%
4
2 votes, 66.7%
5

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


Just ended high school and now got a job in a digitial archiving and archiving company as a part IT-part everything else.

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.
Occupation: Other
Company: Mikrografija d.o.o. http://www.mikrografija.si/
Location: Slovenia Slovenia

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 2 of 2 (Total in Forum: 2) (Refresh)FirstPrevNext
GeneralASP.NETmemberPChott2:59 26 Nov '08  
GeneralRe: ASP.NETmemberMatjaž Grahek4:04 26 Nov '08  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 26 Nov 2008
Editor: Deeksha Shenoy
Copyright 2008 by Matjaž Grahek
Everything else Copyright © CodeProject, 1999-2009
Web20 | Advertise on the Code Project