SplitTiffFile

#include "BITIFF.H"

BOOL CALLBACK SplitTiffFile( LPCTSTR      szSourceFileName,
LPCTSTR      szNewFileName,
int                  nImage,
PROGRESSPROC      lpCallBackFunction,
void*             lpUser)

Description

This function will split a multipage TIFF file into two TIFF file at the position specified by the nImage parameter. The nImage is zero based integer. This function may take a considerable amount of time to perform for large images.

Parameters

LPCTSTR

szSourceFileName

Source TIFF File. It must be a multipage TIFF File.

LPCTSTR

szNewFileName

The new TIFF File generated after the split.

int

nImage

Position where the source TIFF file will be split.

PROGRESSPROC 

lpCallBackFunction

Call back function, a developer can write a function to display a progress bar. If the lpCallBackFunction is not null this function is called for every image.

Void*

lpUser

This pointer is third parameter of the lpCallBackFunction.

Additional Information

This example shows how to use the dll when loading statically including the header file. Otherwise if the dll is loaded dynamically, for further information read the “About the difference of static and dynamic library loading” section of the manual.

Return values

TRUE on success, otherwise FALSE.

Programming notes

If nImage is less than 0 or greater than number of images, the function does nothing and returns immediately with FALSE.

If nImage equals zero, the function move all images to the newly created TIFF File.

int CALLBACK lpCallBackFunction(int nTotalNumberOfImages, int nCurrentImage)

int                    nTotalNumberOfImages            The number of images to be split.

int                    nCurrentImage                           The current image to be split.

void*               lpUser                                         The developers can add a pointer to the function.

Requirements

Header :     Declared in BiTiff.h; include BiTiff.h.

Library :    Use BiTIFF.lib.

DLLs :       BiTiff.dll.

References to related functions

See CutTiffFile(), MergeTiffFiles().