SetRgnMagicWand example for Delphi

// handle OnMouseUp event.
procedure TForm1.LEADImage1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
   LEADImage1.SetRgnMagicWand( x, y, RGB(20,30,15), RGB(15,30,10), L_RGN_SET );
   LEADImage1.RgnFrameType:= ftAnimated;
end;