CopyTiffImage  Method

Description         Copies an image from a tiff file to another tiff file. This method does not require any checking on the images to reach better performance.

Syntax                 RetVal = [BITIFF.]CopyTiffImage  FromHandle Image ToHandle

Returns               RetVal                    Boolean           True on success, False otherwise.

Remarks             FromHandle          LONGLONG The handle of the source file. This handle can be taken from the OpenForCopy method, with tifomRead (=0) mode.

                            Image                     Long                The position of the image to copy. The first image is 0.

                            ToHandle               LONGLONG The handle of the destination file. This handle can be taken from the OpenForCopy method, with tifomAppend (=2) or tifomCreate (=3) mode.

See Also              OpenForCopy Method, CloseCopyHandle Method

Code Example   to split a large, multipage tiff file into single page tiff files.

Dim Count As Integer

Dim Images As Integer

Dim Buffer As String

Dim FileFrom As Long

Dim FileTo As Long

 

Images = Tiff1.ImageCount("d:\multipage.tif")

FileFrom = Tiff1.OpenForCopy("d:\multipage.tif", tifomRead)

For Count = 0 To Images - 1

Buffer = "d:\singlepage" + Str(Count) + ".tif"

FileTo = Tiff1.OpenForCopy(Buffer, tifomCreate)

Call Tiff1.CopyTiffImage(FileFrom, Count, FileTo)

Tiff1.CloseCopyHandle (FileTo)

Next Count

Tiff1.CloseCopyHandle (FileFrom)