ProgressivePasses Example for C++ 5.0 and later

This example shows how to save and load a progressive file.

ILEADRasterIO *pRasterIO=NULL;
   CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);

   pRasterIO->PutEnableMethodErrors(FALSE);

   // Save the current image as a progressive CMP file.
   pRasterIO->PutProgressivePasses(8);
   pRasterIO->Save(m_LEADRasterView1.GetRaster(),"d:\\temp\\tmp.jpg", FILE_JFIF,24, (QFactorConstants)200, SAVE_OVERWRITE);

   // Set properties to show progressive paints when we load.
   m_LEADRasterView1.SetPaintWhileLoad(TRUE);
   m_LEADRasterView1.SetAutoSetRects(FALSE);

   // Load the file we just saved.
   pRasterIO->PutProgressivePasses(PROGRESSIVEPASSES_WHEN_MEANINGFUL);
   pRasterIO->Load(m_LEADRasterView1.GetRaster(), "d:\\temp\\tmp.jpg", 0, 0, 1);

   // Restore the default behavior.
   pRasterIO->PutProgressivePasses(0);
   pRasterIO->Release();