2010.02.15 13:16 "[Tiff] Using libtiff in Visual C++ 6.0", by Weichao Wang

2010.02.16 15:45 "Re: [Tiff] Using libtiff in Visual C++ 6.0", by Weichao Wang

I've implemented reading, writing and dithering tiff in Visual C++ 6.0 for gray scale tiff image, but (unfortunately!!!) only for uncompressed tiff files (and not for tiled files), since I don't know the various (un)compression processes. Now I'd like to make use of libtiff to enable the programm to process compressed files. Is there a step by step guide on how to use libtiff in VC++6? Many thanks!

Is your problem using libtiff or building it with compression support?

Reading compressed files is transparent for many formats as long as support for the compression format was built into your version of libtiff. Some compression formats require other libraries (eg. libz, libjpeg).

Writing compressed files can be as simple as setting a tag once you've created your file but before you start writing data to it:

TIFFSetField( tiff, TIFFTAG_COMPRESSION, COMPRESSION_LZW );

or for deflate compression (which requires libz): TIFFSetField( tiff, TIFFTAG_COMPRESSION, COMPRESSION_ADOBE_DEFLATE );

there many others as well, some of which have particular requirements on how the data is provided and decoded.

I've downloaded libtiff 3.8.2 and installed it in my computer. In the folder C:\Programme\GnuWin32\bin there are 6 .dll files along with many .exe files. So I suppose I needn't to build libtiff myself, am I right? My question is now what I should do (what should I include or import or what so ever into my Visual C++ project) so that I can use functions such as TIFFReadEncodedStrip(...) as if I had implemented them in my project as is shown in Michael Still's (UNIX) example.

Weichao

_________________________________________________________________
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
https://signup.live.com/signup.aspx?id=60969