SaveInterlaced example for C++ Builder

//This example saves the current image as an interlaced GIF file, then loads the saved //image with a paint-while-load effect that shows the interlaced behavior.

   AnsiString szFile;
   LEADRasterIO* pMyRasterIO= NULL;

   CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pMyRasterIO);

   szFile= "c:\\temp\\test.gif";

   //Save the current image as an interlaced GIF file.
   pMyRasterIO->SaveInterlaced = True;
   pMyRasterIO->Save (LEADRasterView1->Raster, AnsiToOLESTR(szFile.c_str()), FILE_GIF, 8, (QFactorConstants)1, SAVE_OVERWRITE);

   //Clear the bitmap so that we can see the paint-while-load effect.
   LEADRasterView1->Raster->Bitmap = 0;

   //Paint the image while loading, showing that it is interlaced.
   LEADRasterView1->PaintWhileLoad = True;
   pMyRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR(szFile.c_str()), 0, 0, 1);

   pMyRasterIO-> Release( );