ShowTransitionDlg Example for Visual Basic

Private Sub Transition_Click()
	Dim RasterEfxDlg As New LEADRasterDlgEfx_U
	Dim RasterKrnDlg As New LEADRasterDlgKrn_U
	Dim nRet As Integer

	RasterKrnDlg.InitDlg 0
	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 = LEAD1.Bitmap

	nRet = RasterEfxDlg.ShowTransitionDlg(hWnd)
	LEAD1.PaintEffect = EFX_EFFECT_WIPE_RECTANGLE_OUT
	LEAD1.AutoRepaint = False
	LEAD1.EffectDelay = RasterEfxDlg.Transition.Delay
	LEAD1.TransitionEffect = RasterEfxDlg.Transition.EffectStyle
	
	If (RasterEfxDlg.Transition.TransitionStyle <= EFX_PATTERN_MAX) Then
		LEAD1.TransitionStyle = EFX_TRANSITION_PATTERN
		If (RasterEfxDlg.Transition.TransitionStyle = EFX_PATTERN_SOLID) Then
			LEAD1.PatternStyle = EFX_PATTERN_SOLID
		Else
			LEAD1.PatternStyle = RasterEfxDlg.Transition.TransitionStyle + 1
		End If

		LEAD1.PatternForeColor = RasterEfxDlg.Transition.ForeColor
		LEAD1.PatternBackColor = RasterEfxDlg.Transition.BackColor
	Else
		LEAD1.TransitionStyle = EFX_TRANSITION_NONE
		LEAD1.GradientStyle = RasterEfxDlg.Transition.TransitionStyle
		LEAD1.GradientStartColor = RasterEfxDlg.Transition.BackColor
		LEAD1.GradientEndColor = RasterEfxDlg.Transition.ForeColor
		LEAD1.GradientSteps = RasterEfxDlg.Transition.Steps
	End If

	LEAD1.TransitionEffect = RasterEfxDlg.Transition.EffectStyle
	LEAD1.EffectGrain = RasterEfxDlg.Transition.Grain
	LEAD1.EffectDelay = RasterEfxDlg.Transition.Delay
	LEAD1.PaintMaxPasses = RasterEfxDlg.Transition.MaxPass
	LEAD1.WandSize = RasterEfxDlg.Transition.WandThickness
	LEAD1.WandColor = RasterEfxDlg.Transition.WandColor
	LEAD1.AutoRepaint = True
	RasterKrnDlg.FreeDlg
End Sub