PaintEffect example for Delphi
The following modules use the KeyDown and KeyUp events to repaint the image with effects.
procedure TForm1.LEADRasterView1KeyDown (Sender: TObject; KeyCode,
Shift: Smallint);
var
sRet: Smallint;
begin
if (KeyCode = 116) then //Code for F5
begin
LEADRasterView1.AutoRepaint := False;
LEADRasterView1.BackErase := True;
LEADRasterView1.EffectGrain := 20;
LEADRasterView1.EffectDelay := 50;
LEADRasterView1.WandSize := 5;
LEADRasterView1.WandColor := RGB(255,255,0); //Yellow Wand
LEADRasterView1.PaintEffect := EFX_EFFECT_WIPE_L_TO_R;
LEADRasterView1.ForceRepaint (sRet);
end;
end;
procedure TForm1.LEADRasterView1KeyUp (Sender: TObject; KeyCode,
Shift: Smallint);
var
sRet: Smallint;
begin
if (KeyCode = 116) then //Code for F5
begin
LEADRasterView1.PaintEffect := EFX_EFFECT_WIPE_R_TO_L;
LEADRasterView1.ForceRepaint(sRet);
LEADRasterView1.PaintEffect := EFX_EFFECT_NONE;
end;
end;