PaintEffect example for C++ Builder
The following modules use the KeyDown and KeyUp events to repaint the image with effects:
procedure TForm1->Lead1KeyDown (Sender: TObject; var Key: Word; Shift: TShiftState);
{
if (Key == 116) //Code for F5
{
Lead1->AutoRepaint = False;
Lead1->BackErase = True;
Lead1->EffectGrain = 20;
Lead1->EffectDelay = 50;
Lead1->WandSize = 5;
Lead1->WandColor = RGB(255,255,0); //Yellow Wand
Lead1->PaintEffect = EFX_EFFECT_WIPE_L_TO_R;
Lead1->ForceRepaint();
}
}
procedure TForm1->Lead1KeyUp (Sender: TObject; var Key: Word; Shift: TShiftState);
{
if (Key == 116) //Code for F5
{
Lead1->PaintEffect = EFX_EFFECT_WIPE_R_TO_L;
Lead1->ForceRepaint();
Lead1->PaintEffect = EFX_EFFECT_NONE;
}
}