ShowGradientDlg Example for Visual Basic

Dim RasterEfxDlg As New LEADRasterDlgEfx
Dim nRet As Integer

Private Sub Gradient_Click()
   RasterEfxDlg.Gradient.StartColor = RGB(0, 0, 255) 
   RasterEfxDlg.Gradient.EndColor = RGB(255, 0, 0) 
   RasterEfxDlg.Gradient.GradientStyle = EFX_GRADIENT_ANGLE_TO_RT
   RasterEfxDlg.Gradient.Steps = 200
   RasterEfxDlg.UIFlags = GRADIENT_SHOW_PREVIEW Or _
                             GRADIENT_AUTOPREVIEW Or _
                             GRADIENT_STARTCOLOR Or _
                             GRADIENT_ENDCOLOR Or _
                             GRADIENT_STEPS Or _
                             GRADIENT_NO_TREEVIEW Or _
                             GRADIENT_CLASS_LINEAR Or _
                             GRADIENT_CLASS_ANGULAR Or _
                             GRADIENT_CLASS_RECTANGULAR Or _
                             GRADIENT_CLASS_ELLIPTICAL Or _
                             GRADIENT_CLASS_CONICAL

   RasterEfxDlg.Bitmap = LEADRasterView1.Raster.Bitmap
   

   nRet = RasterEfxDlg.ShowGradientDlg (hWnd) 
   If (nRet = 0 And RasterEfxDlg.DialogStatus = DLG_OK) Then
      Text1.Text = CStr(RasterEfxDlg.Gradient.GradientStyle
      Text2.Text = CStr(RasterEfxDlg.Gradient.Steps
      Shape1.FillColor = RasterEfxDlg.Gradient.StartColor
      Shape2.FillColor = RasterEfxDlg.Gradient.EndColor
   End If
End Sub