2006.04.11 22:07 "Re: [Tiff] LibTiffDelphi problem with WriteEncodedStrip Newbee", by Joris
Please keep all mail that can be of public interest inside the mailing list. This can be a good thread, useful to many.
> thank you very much for the code you posted. It really worked fine.
> Now I tried to understand the code to alter it, because I want to use > more kinds of compression. As I understood, to use TIFF-Compression
> CCITT3 or 4 I need for example Bitmaps with PixelFormat=pf1bit. I > tried to alter the code you posted like this:
> And disabled the code for making sure that it is pf24bit or pf32bit.
> But it doesn't work so far. I think I forgot something. Or is it just
> because I understood your code false? Can you please explain me? I'm > really new at this TIFF-things... *confused*
The altered parts you show, seem fine.
My guess is you didn't change the next few parts, and the strip memory building parts still assume pf24bit or pf32bit bitmap. Is that correct?
A complete adoption to save a pf1bit Bitmap to a G4 compressed TIFF, may look somewhat like this:
if (Bitmap.PixelFormat<>pf1bit) then
raise Exception.Create('WriteBitmapToTiff is designed for singlebit
RowSize:=((Bitmap.Width+7) div 8);
RowsPerStrip:=((256*1024) div RowSize);
This is untested, edited directly in mail client. If it seems to works, but black and white seem to be swapped in the TIFF file, try PHOTOMETRIC_MINISBLACK instead of PHOTOMETRIC_MINISWHITE.
Joris Van Damme
Download your free TIFF tag viewer for windows here: