PaintEffect example for Visual Basic

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

'don't forget to include L_OCXEFX.BAS
Private Sub LEADRasterView1_KeyDown(ByVal KeyCode As Integer, ByVal Shift As Integer)
If KeyCode = 116 Then 'Code for F5
   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
End If
End Sub
Private Sub LEADRasterView1_KeyUp(ByVal KeyCode As Integer, ByVal Shift As Integer)
If KeyCode = 116 Then 'Code for F5
   LEADRasterView1.PaintEffect = EFX_EFFECT_WIPE_R_TO_L
   LEADRasterView1.ForceRepaint
   LEADRasterView1.PaintEffect = EFX_EFFECT_NONE
End If
End Sub