> 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.