SetRgnMagicWand example for C++ Builder
// handle OnMouseUp event.
void __fastcall TForm1::LEADImage1MouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y)
{
LEADImage1->SetRgnMagicWand(X, Y, RGB(20,30,15), RGB(15,30,10), L_RGN_SET );
LEADImage1->RgnFrameType = ftAnimated;
}