BitmapCompression example for Delphi
{This example toggles the bitmap's compression}
var
oldSize: longint;
begin
oldSize:= LEADImage1.BitmapSize;
if (LEADImage1.BitmapCompression = COMP_NONE) then
begin
{Compress the bitmap}
if (LEADImage1.BitmapBits = 24) then
LEADImage1.BitmapCompression:= COMP_SUPER
else
if LEADImage1.BitmapBits = 1 then
LEADImage1.BitmapCompression:= COMP_RLE
end
else
{Bitmap is compressed. Uncompress it}
LEADImage1.BitmapCompression:= COMP_NONE;
ShowMessage ('old Size = ' + IntToStr(oldSize) + Chr(13) + 'New Size = ' + IntToStr(LEADImage1.BitmapSize));
end;