1Frank,
2
3I attached a file that uses RGBA interface (tif_getimage.c) to read a tiff
4file and convert to a DIB.  It's advantage is that it is easy to read *any*
5tiff file suported by libtiff and easily convert it to a DIB.  The disadvantage
6is that bilevel (B&W) bitmaps (and all other non-rgba images) are also
7converted to RGBA, thus taking up 32x as much memory as needed (4 bytes per
8pixel, rather than 1 bit).  I read tiff files, but don't need to
9write them.  And my files are typically small, so the overhead is mostly
10inconsequential.  But for bilevel images, I overrode the get() and put()
11routines of the RGBA interface to just copy the data from the input raster
12to the output raster, rather than expanding out to full 32 bit format.  It
13would be nice if there were a simple way to handle all palletized images,
14but that would take more custom routines, and it's not that important to me.
15
16Usage:
17
18    m_pDIB = (PBITMAPINFOHEADER)::ReadTIFF(pathName);
19    if (m_pDIB != 0) {
20       m_format = IMAGETYPE_TIF;
21    }
22
23This is intended as Win32, but the modifications for new get() and put()
24routines may be independent of platform.
25
26Thanks for your work supporting the forum and the library!
27
28Regards,
29
30Mark James
31mark@james.net
32