wayne said:
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:
rawing::Bitmap* bm = new System:
rawing::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/d...f/html/frlrfsystemdrawingbitmapclasstopic.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.