SaveIFD example for C++ Builder
// This example will add 100 pages to a file faster by continuously using the IFD of the last page
int Page;
LEADRasterIO* pRasterIO= NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
// Save page 1, to make sure the file exists
pRasterIO->Save (LEADRasterView1->Raster, AnsiToOLESTR("c:\\temp\\test.tif"), FILE_TIF, 1, (QFactorConstants)0, SAVE_APPEND);
for (Page= 2; Page <= 100; Page ++)
{
//get the IFD of the last page
pRasterIO->GetFileInfo (LEADRasterView1->Raster, AnsiToOLESTR("c:\\temp\\test.tif"), 100000, 0);
pRasterIO->SaveIFD = pRasterIO->InfoIFD;
pRasterIO->Save (LEADRasterView1->Raster,
AnsiToOLESTR("c:\\temp\\test.tif"), FILE_TIF,
1, (QFactorConstants)0, SAVE_APPEND);
}
// reset the SaveIFD property so the other Save calls will work properly
pRasterIO->SaveIFD = 0;
pRasterIO-> Release( );