CompactFile Example for C++ 5.0 and later
Example 1:
void TestCompactFileExample1(ILEADRasterIO * pRasterIO)
{
/* This example will compact all the pages in a TIFF file. It will create a new file called dstfile.tif */
short nRet = pRasterIO->CompactFile(TEXT("srcfile.tif"), TEXT("dstfile.tif"), 0, 0, -1, SAVE_OVERWRITE, 0);
if(nRet != 0)
MessageBox(NULL, TEXT("Error compacting file!"), TEXT("ERROR"), MB_OK);
}
Example 2:
void TestCompactFileExample2(ILEADRasterIO * pRasterIO)
{
/* This example will compact all the pages in a TIFF file. It will append all the pages to an existing file called dstfile.tif */
short nRet = pRasterIO->CompactFile(TEXT("srcfile.tif"), TEXT("dstfile.tif"), 0, 0, -1, SAVE_APPEND, -1);
if (nRet != 0)
MessageBox(NULL, TEXT("Error compacting file!"), TEXT("ERROR"), MB_OK);
}