There are several methods available to combine images.
The simplest way that save the DIB to an existing TIFF image. In this case the DIB will be appended to the image. Use the SaveDIBInTiffFileExt (SaveDIBInTiffFormat in ocx) for this.
Use the InsertTiffImage function (method) to insert or change a device independent bitmap to a TIFF image. (There are other functions: DeleteTiffImage, ReorderTiffFile to delete a DIB from a TIFF file and reorder the image.)
Use the MergeTiffFiles to combine TIFF images.
[C++]
/* Merge TIFF files */
#include “BiTiff.h”
BOOL bRet;
TCHAR szDest[MAX_PATH], szSource[MAX_PATH];
_tcscpy_s(szDest, MAX_PATH , _T(“C:\\Images\\Dest.tif”));
_tcscpy_s(szSource, MAX_PATH , _T(C:\\Images\\Source.tif”));
/* 1. parameter: Path and name of the destination file
2. parameter: Path and name of the source file
3. parameter: Call back function, a developers can
display a progress bar.
4. parameter: This pointer is the third parameter of the
lpCallBackFunction.
The szSource will be appended to the szDest. The
szSource can be multipage TIFF image and every page in
szSource will be appended to szDest. If szDest does not
exist, the szSource will be copied to szDest. */
bRet = MergeTiffFiles(szDest, szSource, NULL, NULL);
if (!bRet)
{
// Error
}
[C#]
/* Merge TIFF files */
bool bRet;
string szSource, szDest;
szSource = “C:\\Images\\Source.tif”;
szDest = “C:\\Images\\Dest.tif”;
bRet = BiTiff.MergeTiffFiles(szDest, szSource);
if (!bRet)
{
// Error
}
Note: Use the MergeTiffProgress event for get an event after a page has appended to the TIFF image.