PaintEffect example for C++ Builder

The following modules use the KeyDown and KeyUp events to repaint the image with effects.

#include "L_ComEfx.h"

void __fastcall TForm1::LEADRasterView1KeyDown(TObject *Sender,
      short KeyCode, short Shift)
{
   if (KeyCode == 116) //Code for F5
   {
      LEADRasterView1->AutoRepaint = False;
      LEADRasterView1->BackErase = True;
      LEADRasterView1->EffectGrain = 20;
      LEADRasterView1->EffectDelay = 50;
      LEADRasterView1->WandSize = 5;
      LEADRasterView1->WandColor = (TColor)RGB(255,255,0);   //Yellow Wand
      LEADRasterView1->PaintEffect = EFX_EFFECT_WIPE_L_TO_R;
      LEADRasterView1->ForceRepaint ();
   }
}

void __fastcall TForm1::LEADRasterView1KeyUp(TObject *Sender, short KeyCode,
      short Shift)
{
   if (KeyCode == 116) //Code for F5
   {
      LEADRasterView1->PaintEffect = EFX_EFFECT_WIPE_R_TO_L;
      LEADRasterView1->ForceRepaint();
      LEADRasterView1->PaintEffect = EFX_EFFECT_NONE;
   }
}