PaintTransitionMaxPasses example for Visual Basic

This example includes two procedures. First, a button click starts a multi-pass paint effect; then LEAD's PaintNotification event changes the direction of the effect on each pass.

'don't forget to include L_OCXEFX.BAS
Private Sub StartEffect_Click()
  Dim RasterIO As New LEADRasterIO
  LEADRasterView1.AutoRepaint = False
  LEADRasterView1.PaintEffect = EFX_EFFECT_WIPE_RECTANGLE_IN 'Set the Effect
  LEADRasterView1.EffectDelay = 100
  LEADRasterView1.PaintTransitionMaxPasses = 5                   '5 total passes
  LEADRasterView1.PaintTransitionPass = 1                        'Start with pass number 1
  LEADRasterView1.PaintNotificationDelay = 200         'Delay 200 milliseconds between passes
  RasterIO.Load LEADRasterView1.Raster, "d:\temp\240bit.bmp", 0, 0, 1 'Load the image
  LEADRasterView1.AutoRepaint = True
End Sub

Private Sub LEADRasterView1_PaintNotification(ByVal uPass As Integer, ByVal uType As Integer)
  'If the first pass is complete
  If ((uType = EFX_NOTIFY_IMAGE) And (uPass > 0)) Then
      'Toggle the effect from left_to_right to right_to_left
      If LEADRasterView1.TransitionEffect= EFX_EFFECT_WIPE_RECTANGLE_IN Then
          LEADRasterView1.TransitionEffect = EFX_EFFECT_WIPE_RECTANGLE_OUT
      Else
          LEADRasterView1.TransitionEffect = EFX_EFFECT_WIPE_RECTANGLE_IN
      End If
  End If 
End Sub