BitmapCompression example for C++ Builder
// This example toggles the bitmap’s compression
long oldSize;
/*This example toggles the bitmap's compression*/
int oldSize;
oldSize= LEADImage1->BitmapSize;
if (LEADImage1->BitmapCompression == COMP_NONE)
{
/*Compress the bitmap*/
if (LEADImage1->BitmapBits == 24)
LEADImage1->BitmapCompression= COMP_SUPER;
else
if (LEADImage1->BitmapBits == 1)
LEADImage1->BitmapCompression= COMP_RLE;
}
else
/*Bitmap is compressed-> Uncompress it*/
LEADImage1->BitmapCompression= COMP_NONE;
ShowMessage ("old Size = " + IntToStr(oldSize) + "\nNew Size = " + IntToStr(LEADImage1->BitmapSize));