CreateMaskFromBitmapRgn example for Delphi
procedure TForm1.Button1Click(Sender: TObject);
var
nRet: Integer;
begin
{ This example loads an image, sets a color region using black, }
{ and then creates a 1-bit mask image from that bitmap. }
nRet:= LEADImage1.Load ('IMAGE1.CMP', 0, 1, 1);
if(nRet = SUCCESS)then
begin
LEADImage1.SetRgnColor(RGB(0, 0, 0), L_RGN_SET);
nRet:= LEADImage1.CreateMaskFromBitmapRgn();
if(nRet = SUCCESS)then
LEADImage2.Bitmap:= LEADImage1.MaskBitmap;
end;
end;