There are many ways to create or delete images from a multipage TIFF file.
In order to create a multipage TIFF file you can do one of the following:
Save a DIB to a file which already exists and the DIB will be appended to the image
Use the InsertTiffImage function (or method) from BiTiff.dll (BiTiff.ocx)
Use MergeTiffFiles function (or method) from BiTiff.dll (BiTiff.ocx)
To delete an image from a multipage TIFF file:
Use DeleteTiffImage function (method) from BiTiff.dll (BiTiff.ocx)
Use SplitTiffFile function (method) from BiTiff.dll (BiTiff.ocx)
[C++]
/* Insert a DIB into a TIFF file*/
#include “BiTiff.h”
BOOL bRet;
/* 1. parameter: Path and name of the TIFF file
2. parameter: Handle of the DIB to insert
3. parameter: Compression type
4. parameter: Display dialog box
5. parameter: Fill order (1 - normal 2 - reverse)
6. parameter: Position to insert or change image at
7. parameter: Fast or Slow saving method
8. parameter: Overwrite or insert the image */
bRet = InsertTiffImage(_T(“C:\\Images\\Test.tif”), hDib,
TCOM_NOCOMP, TRUE, NORM_BIT_ORDER,
3, FALSE, FALSE);
if (!bRet)
{
// Error
}
[C#]
/* Insert a DIB into a TIFF file*/
bool bRet;
/* 1. parameter: Path and name of the TIFF file
2. parameter: Handle of the DIB to insert
3. parameter: Compression type
4. parameter: Display dialog box
5. parameter: Fill order (1 - normal 2 - reverse)
6. parameter: Position to insert or change image at
7. parameter: Fast or Slow saving method
8. parameter: Overwrite or insert the image */
bRet = BiTiff.InsertTiffImage(“C:\\Images\\Test.tif”, hDib,
BITIFFLib.enumCompressionTypes.TCOMP_NOCOMP, true, BITIFFLib.enumFillOrder.tiffoNormal,
3, false, false);
if (!bRet)
{
// Error
}