ShowShapeDlg Example for Visual Basic

Dim WithEvents RasterFXD As  LEADRasterFXD
Dim RasterEfxDlg As New LEADRasterDlgEfx
Dim nRet As Integer

Private Sub Shape_Click()
   RasterEfxDlg.Shape.ShapeStyle = FXD_SHAPE_PARALLELOGRAM_R
   RasterEfxDlg.Shape.BackColor = RGB(0, 0, 255) 
   RasterEfxDlg.Shape.ForeColor = RGB(255, 0, 0) 
   RasterEfxDlg.Shape.BackgroundStyle = FXD_BACKSTYLE_OPAQUE
   RasterEfxDlg.Shape.FillStyle = FXD_PATTERN_SOLID
   RasterEfxDlg.Shape.BorderColor = RGB(100, 255, 100) 
   RasterEfxDlg.Shape.BorderStyle = FXD_BORDERSTYLE_SOLID
   RasterEfxDlg.Shape.BorderThickness = 5
   RasterEfxDlg.Shape.InnerHiliteColor = RGB(255, 255, 255) 
   RasterEfxDlg.Shape.InnerShadowColor = RGB(0, 0, 0) 
   RasterEfxDlg.Shape.InnerStyle = FXD_SHAPE_INNERSTYLE_INSET
   RasterEfxDlg.Shape.InnerThickness = 3
   RasterEfxDlg.Shape.OuterHiliteColor = RGB(255, 255, 0) 
   RasterEfxDlg.Shape.OuterShadowColor = RGB(255, 0, 255) 
   RasterEfxDlg.Shape.OuterStyle = FXD_SHAPE_OUTERSTYLE_INSET
   RasterEfxDlg.Shape.OuterThickness = 5
   RasterEfxDlg.Shape.ShadowXDepth = 10
   RasterEfxDlg.Shape.ShadowColor = RGB(128, 128, 128) 
   RasterEfxDlg.UIFlags = SHAPE_SHOW_PREVIEW Or _
                         SHAPE_AUTOPREVIEW Or _
                         SHAPE_BACKSTYLE Or _
                         SHAPE_FILLSTYLE Or _
                         SHAPE_FORE_BACK_COLOR Or _
                         SHAPE_BORDERSTYLE Or _
                         SHAPE_BORDERWIDTH Or _
                         SHAPE_BORDERCOLOR Or _
                         SHAPE_INNERSTYLE Or _
                         SHAPE_INNERWIDTH Or _
                         SHAPE_INNER_HILITE_SHADOW Or _
                         SHAPE_OUTERSTYLE Or _
                         SHAPE_OUTERWIDTH Or _
                         SHAPE_OUTER_HILITE_SHADOW Or _
                         SHAPE_SHADOWCOLOR Or _
                         SHAPE_SHADOW_X_Y Or _
                         SHAPE_BROWSEIMAGE Or _
                         SHAPE_CLASS_SQUARE Or _
                         SHAPE_CLASS_RECTANGLE Or _
                         SHAPE_CLASS_PARALLELOGRAM Or _
                         SHAPE_CLASS_TRAPEZOID Or SHAPE_CLASS_TRIANGLE Or _
                         SHAPE_CLASS_OTHER Or SHAPE_CLASS_CIRCLE Or _
                         SHAPE_CLASS_ELLIPSE Or SHAPE_CLASS_STAR Or _
                         SHAPE_CLASS_CROSS Or SHAPE_CLASS_ARROW

   RasterEfxDlg.Bitmap = LEADRasterView1.Raster.Bitmap
   RasterEfxDlg.EnableMethodErrors = False
   nRet = RasterEfxDlg.ShowShapeDlg (hWnd) 
   If (nRet = 0 And RasterEfxDlg.DialogStatus = DLG_OK) Then
      RasterFXD.ShapeLeft = 50
      RasterFXD.ShapeTop = 50
      
      RasterFXD.ShapeWidth = LEADRasterView1.DstWidth - 50
      RasterFXD.ShapeHeight = LEADRasterView1.DstHeight - 50
      RasterFXD.PatternBackColor = RasterEfxDlg.Shape.BackColor
      RasterFXD.BackgroundImageLeft = 0
      RasterFXD.BackgroundImageTop = 0
      RasterFXD.BackgroundImageWidth = Raster.BitmapWidth
      RasterFXD.BackgroundImageHeight = Raster.GetBitmapHeight
      RasterFXD.ShapeBackgroundStyle = RasterEfxDlg.Shape.BackgroundStyle
      RasterFXD.PatternForeColor = RasterEfxDlg.Shape.ForeColor
      RasterFXD.PatternStyle = RasterEfxDlg.Shape.FillStyle
      RasterFXD.ShapeBorderColor = RasterEfxDlg.Shape.BorderColor
      RasterFXD.ShapeBorderStyle = RasterEfxDlg.Shape.BorderStyle
      RasterFXD.ShapeBorderThickness = RasterEfxDlg.Shape.BorderThickness
      RasterFXD.ShapeInnerBandHiliteColor = RasterEfxDlg.Shape.InnerHiliteColor
      RasterFXD.ShapeInnerBandShadowColor = RasterEfxDlg.Shape.InnerShadowColor
      RasterFXD.ShapeInnerBandStyle = RasterEfxDlg.Shape.InnerStyle
      RasterFXD.ShapeInnerBandThickness = RasterEfxDlg.Shape.InnerThickness
      RasterFXD.ShapeOuterBandHiliteColor = RasterEfxDlg.Shape.OuterHiliteColor
      RasterFXD.ShapeOuterBandShadowColor = RasterEfxDlg.Shape.OuterShadowColor
      RasterFXD.ShapeOuterBandStyle = RasterEfxDlg.Shape.OuterStyle
      RasterFXD.ShapeOuterBandThickness = RasterEfxDlg.Shape.OuterThickness
      RasterFXD.ShadowXDepth = RasterEfxDlg.Shape.ShadowXDepth
      RasterFXD.ShadowYDepth = RasterEfxDlg.Shape.ShadowYDepth
      RasterFXD.ShadowColor = RasterEfxDlg.Shape.ShadowColor
      RasterFXD.DrawShape LEADRasterView1.Raster, LEADRasterView1.GetClientDC, RasterEfxDlg.Shape.Shape, 0
   End If
End Sub

Private Sub RasterEfxDlg_DlgHelp(ByVal DlgFrom As Long, ByVal CtlID As Long) 
   Select Case DlgFrom

   Case HELP_EFFECT
      MsgBox " Help from Effect dialog "

   Case HELP_SHAPE
      MsgBox " Help from Shape dialog "

   Case HELP_GETTEXT
      MsgBox " Help from GetText dialog "

   Case HELP_GETGRADIENT
      MsgBox " Help from GetGradient dialog "

   Case HELP_GETTRANSITION
      MsgBox " Help from GetTransition dialog "

   End Select
End Sub