AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

2008.07.03 15:36 "[Tiff] Converting BMP to Tiff", by Lou Feliz

Hello,

I found a thread with an example function for converting a BMP to TIFF. It does work, however I am having a problem. The BMP is Black text on a white background and the resulting TIF is white text on black background. What causes this? I am a newbie to graphics programming, but am thinking I missed something real simple here.

   BMP := TBitmap.create;
   with BMP do
   begin
      Width := 920;
      Height := 1150;
      Canvas.Brush.Color := clWhite;
      Pixelformat := pf1bit ;
      with Canvas.Font do begin
        Name := 'Arial';
        Size := 12;
        Color := clBlack;
      end;
      Canvas.TextOut(50,100,'Hello World');
   end;

   BMP.SaveToFile('c:\temp\TEST.BMP');
// THE BMP Saved to a file looks fine

   WriteBitmapToTiff(BMP,'c:\temp\TEST.TIF');
   BMP.Free;

The Function IAm using is as found in this thread http://www.asmail.be/msg0054866090.html