Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / February 2005

Tip: Looking for answers? Try searching our database.

graphics programming with tiff

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
wayne - 31 Jan 2005 05:29 GMT
Hi,

May I know how to use VC++ to write a program that can read a TIFF
image file?

thanks alot


Derrick Coetzee [MSFT] - 31 Jan 2005 20:41 GMT
> May I know how to use VC++ to write a program that can read a TIFF
> image file?

If you're writing a managed application, you can simply add
System.Drawing.dll to your references and then do this:

System::Drawing::Bitmap* bm = new System::Drawing::Bitmap("foo.tif");

The Bitmap object can then be drawn or its pixel data examined. See Bitmap's
MSDN entry for more information:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlr
fsystemdrawingbitmapclasstopic.asp


Note, however, that indexed formats are *not* supported. You would have to
first convert it to a non-indexed palette using a paint program or image
conversion tool. If you need to handle types of TIFFs that the .NET library
cannot handle, consider the LEADTOOLS Raster Imaging SDK, which supports
many additional kinds of TIFFs:

http://www.leadtools.com/SDK/Raster/Raster-Imaging.htm

Or the managed version:

http://www.leadtools.com/SDK/dotNET/RIP-for.NET.htm

If you're writing an unmanaged application, particularly if you must support
older versions of Windows, you might check out this project which uses
libtiff, a free TIFF library, to load a TIFF file into an MFC CBitmap:

http://www.codeproject.com/bitmap/BitmapsToTiffs.asp

I hope this helps.
Signature

Derrick Coetzee, Microsoft Speech Server developer
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included code samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Steve McLellan - 02 Feb 2005 18:03 GMT
In addition to the excellent answer below, you might want to look at libtiff
(libtiff.org) which isn't maintained that much anymore but does work. It's
open source (and unmanaged) but supports most (if not all) formats, and is
reasonably easily extensible.

Steve

>> May I know how to use VC++ to write a program that can read a TIFF
>> image file?
[quoted text clipped - 31 lines]
>
> I hope this helps.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.