BitmapCompression example for C++ 5.0 and later
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
// This example toggles the bitmap's compression
long oldSize = m_RasterView1.GetRaster ().GetBitmapSize();
if(m_RasterView1.GetRaster().GetBitmapCompression() == COMP_NONE)
{
// Compress the bitmap
if(m_RasterView1.GetRaster().GetBitmapBits () == 24)
pRasterProc->SetBitmapCompression(m_RasterView1.GetRaster(), COMP_SUPER);
else if(m_RasterView1.GetRaster().GetBitmapBits () == 1)
pRasterProc->SetBitmap Compression(m_RasterView1.GetRaster(), COMP_RLE);
}
else // Bitmap is compressed. Uncompress it
pRasterProc->SetBitmap Compression(m_RasterView1.GetRaster(), COMP_NONE);
CString strMsg;
strMsg.Format(TEXT("old Size = %ld\nNew Size = %ld"), oldSize, m_RasterView1.GetRaster().GetBitmapSize());
AfxMessageBox(strMsg);
pRasterProc->Release();