SetRgnFromMask example for Delphi
{This example sets and colored a region into LEADImage1 using a 1-bit black-and-white mask image.}
procedure TForm1.Button3Click(Sender: TObject);
var
nRet: Integer;
begin
nRet:= LEADImage1.Load ('IMAGE1.CMP', 0, 1, 1);
if(nRet = SUCCESS)then
begin
nRet:= LEADMask.Load ('MASK.TIF', 0, 1, 1);
if(nRet = SUCCESS)then
begin
LEADImage1.MaskBitmap:= LEADMask.Bitmap;
LEADImage1.SetRgnFromMask (L_RGN_SET);
LEADImage1.Fill (RGB(0, 255, 0));
end;
end;
end;