Return-Path: <tiff-bounces@remotesensing.org>
Received: from xserve.flids.com (adsl-065-083-169-202.sip.mco.bellsouth.net [65.83.169.202])
        by inmx018.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id j59GQ82I030648
        for <joris.at.lebbeke@skynet.be>; Thu, 9 Jun 2005 18:26:08 +0200
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from adsl-065-083-169-202.sip.mco.bellsouth.net (localhost [127.0.0.1])
	by xserve.flids.com (Postfix) with ESMTP
	id DE46625FED0C; Thu,  9 Jun 2005 12:25:34 -0400 (EDT)
X-Original-To: tiff@remotesensing.org
Delivered-To: tiff@remotesensing.org
Received: from postfix3-2.free.fr (postfix3-2.free.fr [213.228.0.169])
	by xserve.flids.com (Postfix) with ESMTP id 31A9525FECE9
	for <tiff@remotesensing.org>; Thu,  9 Jun 2005 12:25:32 -0400 (EDT)
Received: from [192.168.1.5] (lns-vlq-17f-81-56-168-47.adsl.proxad.net
	[81.56.168.47])
	by postfix3-2.free.fr (Postfix) with ESMTP id 4E1BFC17E;
	Thu,  9 Jun 2005 18:25:24 +0200 (CEST)
Received: from 127.0.0.1 (AVG SMTP 7.0.300 [267.6.5]);
	Thu, 09 Jun 2005 18:25:22 +0200
Message-ID: <003101c56d0f$d5d76f90$0501a8c0@MIKO4>
From: "Michel Salvagniac" <michel.salvagniac@free.fr>
To: "Matthias Lach" <Matthias.Lach@Telefax400.de>, <tiff@remotesensing.org>
References: <200506091251.j59Cp7K14902@dtagbrg1.telefax400.de>
Subject: Re: [Tiff] TIFF save
Date: Thu, 9 Jun 2005 18:25:22 +0200
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
	reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Cc: 
X-BeenThere: tiff@remotesensing.org
X-Mailman-Version: 2.1.2
Precedence: list
List-Id: TIFF and libtiff discussion  <tiff.remotesensing.org>
List-Unsubscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=unsubscribe>
List-Archive: <http://xserve.flids.com/pipermail/tiff>
List-Post: <mailto:tiff@remotesensing.org>
List-Help: <mailto:tiff-request@remotesensing.org?subject=help>
List-Subscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=subscribe>
Sender: tiff-bounces@remotesensing.org
Errors-To: tiff-bounces@remotesensing.org
X-UIDL: 000000000023ceae.00000374
X-MSP-STORE: Thu, 09 Jun 2005 18:26:12 +0200
Status:   

Hi,
Assuming you can get save or put your image data in a bitmap, this code can 
be helpful (it was for me). I use G4 compression.
var
BMP:TBitmap;
imgtif:PTIFF;
hauteur,largeur : integer;
resoTiff:double;
artiste:string;
begin
   artiste:='put your name here'
   resoTiff:=200.0;
   hauteur:=BMP.Height;
   largeur:=BMP.Width;

imgtif:=TIFFOpen('test.tif', 'w') ;
 TIFFSetField(imgtif, TIFFTAG_IMAGEWIDTH, largeur);
  TIFFSetField(imgtif, TIFFTAG_IMAGELENGTH, hauteur);
  TIFFSetField(imgtif, TIFFTAG_BITSPERSAMPLE, 1);
  TIFFSetField(imgtif, TIFFTAG_SAMPLESPERPIXEL, 1);
  TIFFSetField(imgtif, TIFFTAG_ROWSPERSTRIP, hauteur);

  TIFFSetField(imgtif, TIFFTAG_COMPRESSION, COMPRESSION_CCITTFAX4);
  TIFFSetField(imgtif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE);
  TIFFSetField(imgtif, TIFFTAG_FILLORDER, FILLORDER_MSB2LSB);
  TIFFSetField(imgtif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);

  TIFFSetField(imgtif, TIFFTAG_XRESOLUTION, resoTiff);
  TIFFSetField(imgtif, TIFFTAG_YRESOLUTION, resoTiff);
  TIFFSetField(imgtif, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH);
  TIFFSetField(imgtif, TIFFTAG_SOFTWARE, 'LibTiffDelphi');
  TIFFSetField(imgtif, TIFFTAG_ARTIST, user);

      for y :=0 to hauteur - 1 do
        begin
       TIFFWriteScanline(imgtif,BMP.Scanline[y],y,0) ;
        end;
TIFFClose(imgtif);
end;

Have fun.
Many thanks to Joris Van Damme and LibTiffDelphi  : ))

_______________________________________________
Tiff mailing list: Tiff@remotesensing.org
http://xserve.flids.com/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
