ShowTransitionDlg Example for Visual Basic

Dim RasterEfxDlg As New LEADRasterDlgEfx
Dim nRet As Integer

Private Sub Transition_Click()
   RasterEfxDlg.Transition.TransitionStyle = EFX_TRANSITION_GRADIENT
   RasterEfxDlg.Transition.EffectStyle = EFX_EFFECT_WIPE_CIRCLE_CLASS
   RasterEfxDlg.Transition.ForeColor = RGB(255, 255, 0) 
   RasterEfxDlg.Transition.BackColor = RGB(255, 0, 255) 
   RasterEfxDlg.Transition.Steps = 120
   RasterEfxDlg.Transition.Delay = 20
   RasterEfxDlg.Transition.Grain = 5
   RasterEfxDlg.Transition.WandThickness = 5
   RasterEfxDlg.Transition.WandColor = RGB(255, 255, 0) 
   RasterEfxDlg.Transition.Transparent = True
   RasterEfxDlg.Transition.TransparentColor = RGB(255, 0, 0) 
   RasterEfxDlg.UIFlags = TRANSITION_SHOW_PREVIEW Or _
                             TRANSITION_FORECOLOR Or _
                             TRANSITION_BACKCOLOR Or _
                             TRANSITION_DELAY Or _
                             TRANSITION_GRAIN Or _
                             TRANSITION_EFFECT Or _
                             TRANSITION_PASSES Or _
                             TRANSITION_WAND Or _
                             TRANSITION_TRANSPARENT Or _
                             TRANSITION_GRADIENT

   RasterEfxDlg.Bitmap = LEADRasterView1.Raster.Bitmap
   
   nRet = RasterEfxDlg.ShowTransitionDlg (hWnd) 
   LEADRasterView1.AutoRepaint = False
   LEADRasterView1.TransitionDelay = RasterEfxDlg.Transition.Delay
   LEADRasterView1.TransitionEffect = RasterEfxDlg.Transition.Effect
   If (RasterEfxDlg.Transition.TransitionStyle <= FXD_PATTERN_MAX) Then
         
      LEADRasterView1.TransitionStyle = EFX_TRANSITION_PATTERN
   
      If (RasterEfxDlg.Transition.TransitionStyle = FXD_PATTERN_SOLID) Then
         LEADRasterView1.PatternStyle = EFX_PATTERN_SOLID
      Else
         LEADRasterView1.PatternStyle = RasterEfxDlg.Transition.TransitionStyle + 1
      End If
         
      LEADRasterView1.PatternForeColor = RasterEfxDlg.Transition.ForeColor
      LEADRasterView1.PatternBackColor = RasterEfxDlg.Transition.BackColor
                 
   Else
      LEADRasterView1.TransitionStyle = EFX_TRANSITION_NONE
      LEADRasterView1.GradientStyle = RasterEfxDlg.Transition.TransitionStyle
      LEADRasterView1.GradientStartColor = RasterEfxDlg.Transition.BackColor
      LEADRasterView1.GradientEndColor = RasterEfxDlg.Transition.ForeColor
      LEADRasterView1.GradientSteps = RasterEfxDlg.Transition.Steps
   End If
      
      LEADRasterView1.TransitionEffect = RasterEfxDlg.Transition.Effect
      LEADRasterView1.EffectGrain = RasterEfxDlg.Transition.Grain
      LEADRasterView1.TransitionDelay = RasterEfxDlg.Transition.Delay
      LEADRasterView1.PaintTransitionMaxPasses = RasterEfxDlg.Transition.MaxPass
      LEADRasterView1.WandSize = RasterEfxDlg.Transition.WandThickness
      LEADRasterView1.WandColor = RasterEfxDlg.Transition.WandColor
      LEADRasterView1.AutoRepaint = True
End Sub