ShowHelpButton example for Visual Basic

ColorDlg

EffectsDlg

FileDlg

ImagDlg

ImageEfxDlg

WebDlg

DocDlg

 

//ColorDlg//

Dim WithEvents LEADColorDlg As LEADRasterDlgClr_U

Dim DlgKrn As New LEADRasterDlgKrn_U

Dim nRet As Integer

Private Sub Command1_Click()

   LEADColorDlg.EnableZoomToFit = False

   LEADColorDlg.UIFlags = BALANCECOLORS_SHOW_PREVIEW Or _

                            BALANCECOLORS_SHOW_TOOL_ZOOMLEVEL

   LEADColorDlg.Bitmap = LEAD1.Bitmap

   LEADColorDlg.EnableMethodErrors = False

   LEADColorDlg.ShowHelpButton = True

   nRet = LEADColorDlg.ShowBalanceColorsDlg(hWnd)

   If (nRet = 0 And LEADColorDlg.DialogStatus = DLG_OK) Then

   LEAD1.BalanceColors LEADColorDlg.RedToRed, LEADColorDlg.RedToGreen, LEADColorDlg.RedToBlue, _

                                 LEADColorDlg.GreenToRed, LEADColorDlg.GreenToGreen, LEADColorDlg.GreenToBlue, _

                                 LEADColorDlg.BlueToRed, LEADColorDlg.BlueToGreen, LEADColorDlg.BlueToBlue

   End If

End Sub

Private Sub Form_Load()

Set LEADColorDlg = New LEADRasterDlgClr_U

DlgKrn.InitDlg (INIT_WITH_COLOR)

LEAD1.Load "c:\test.bmp", 0, 1, 1

End Sub

Private Sub LEADColorDlg_DlgHelp(ByVal DlgFrom As Long, ByVal CtlID As Long)

   Select Case DlgFrom

      Case HELP_BALANCECOLORS

         MsgBox "Help from BalanceColors dialog"

      

      Case HELP_COLOREDGRAY

         MsgBox "Help from ColoredGray dialog"

   

      Case HELP_GRAYSCALE

         MsgBox "Help from GrayScale dialog"

   

      Case HELP_REMAPHUE

         MsgBox "Help from RemapHue dialog"

   

      Case HELP_REMAPINTENSITY

         MsgBox "Help from RemapUntensity dialog"

   End Select

End Sub

//EffectsDlg//

Dim WithEvents RasterEfxDlg As LEADRasterDlgEfx_U

Dim DlgKrn As New LEADRasterDlgKrn_U

Dim nRet As Integer

Private Sub Command1_Click()

   RasterEfxDlg.Shape.ShapeStyle = EFX_SHAPE_PARALLELOGRAM_R

   RasterEfxDlg.Shape.BackColor = RGB(0, 0, 255)

   RasterEfxDlg.Shape.ForeColor = RGB(255, 0, 0)

   RasterEfxDlg.Shape.BackgroundStyle = EFX_BACKSTYLE_OPAQUE

   RasterEfxDlg.Shape.FillStyle = EFX_PATTERN_SOLID

   RasterEfxDlg.Shape.BorderColor = RGB(100, 255, 100)

   RasterEfxDlg.Shape.BorderStyle = EFX_BORDERSTYLE_SOLID

   RasterEfxDlg.Shape.BorderThickness = 5

   RasterEfxDlg.Shape.InnerHiliteColor = RGB(255, 255, 255)

   RasterEfxDlg.Shape.InnerShadowColor = RGB(0, 0, 0)

   RasterEfxDlg.Shape.InnerStyle = EFX_SHAPE_INNERSTYLE_INSET

   RasterEfxDlg.Shape.InnerThickness = 3

   RasterEfxDlg.Shape.OuterHiliteColor = RGB(255, 255, 0)

   RasterEfxDlg.Shape.OuterShadowColor = RGB(255, 0, 255)

   RasterEfxDlg.Shape.OuterStyle = EFX_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 = LEAD1.Bitmap

   RasterEfxDlg.EnableMethodErrors = False

   RasterEfxDlg.ShowHelpButton = True

   

   nRet = RasterEfxDlg.ShowShapeDlg(hWnd)

   If (nRet = 0 And RasterEfxDlg.DialogStatus = DLG_OK) Then

      LEAD1.ShapeLeft = 50

      LEAD1.ShapeTop = 50

      

      LEAD1.ShapeWidth = LEAD1.DstWidth - 50

      LEAD1.ShapeHeight = LEAD1.DstHeight - 50

      LEAD1.PatternBackColor = RasterEfxDlg.Shape.BackColor

      LEAD1.BackgroundImageLeft = 0

      LEAD1.BackgroundImageTop = 0

      LEAD1.BackgroundImageWidth = LEAD1.BitmapWidth

      LEAD1.BackgroundImageHeight = LEAD1.GetBitmapHeight

      LEAD1.ShapeBackgroundStyle = RasterEfxDlg.Shape.BackgroundStyle

      LEAD1.PatternForeColor = RasterEfxDlg.Shape.ForeColor

      LEAD1.PatternStyle = RasterEfxDlg.Shape.FillStyle

      LEAD1.ShapeBorderColor = RasterEfxDlg.Shape.BorderColor

      LEAD1.ShapeBorderStyle = RasterEfxDlg.Shape.BorderStyle

      LEAD1.ShapeBorderThickness = RasterEfxDlg.Shape.BorderThickness

      LEAD1.ShapeInnerBandHiliteColor = RasterEfxDlg.Shape.InnerHiliteColor

      LEAD1.ShapeInnerBandShadowColor = RasterEfxDlg.Shape.InnerShadowColor

      LEAD1.ShapeInnerBandStyle = RasterEfxDlg.Shape.InnerStyle

      LEAD1.ShapeInnerBandThickness = RasterEfxDlg.Shape.InnerThickness

      LEAD1.ShapeOuterBandHiliteColor = RasterEfxDlg.Shape.OuterHiliteColor

      LEAD1.ShapeOuterBandShadowColor = RasterEfxDlg.Shape.OuterShadowColor

      LEAD1.ShapeOuterBandStyle = RasterEfxDlg.Shape.OuterStyle

      LEAD1.ShapeOuterBandThickness = RasterEfxDlg.Shape.OuterThickness

      LEAD1.ShadowXDepth = RasterEfxDlg.Shape.ShadowXDepth

      LEAD1.ShadowYDepth = RasterEfxDlg.Shape.ShadowYDepth

      LEAD1.ShadowColor = RasterEfxDlg.Shape.ShadowColor

      LEAD1.DrawShape RasterEfxDlg.Shape.Shape, LEAD1.GetClientDC

   End If

End Sub

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

   Select Case DlgFrom

   Case HELP_GETEFFECT

      MsgBox " Help from Effect dialog"

   Case HELP_GETSHAPE

      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

Private Sub Form_Load()

DlgKrn.InitDlg (INIT_WITH_COLOR)

Set RasterEfxDlg = New LEADRasterDlgEfx_U

LEAD1.Load "c:\test.bmp", 0, 1, 1

End Sub

//FileDlg//

Dim WithEvents RasterFileDlg As LEADRasterDlgFile_U

Dim KrnDlg As New LEADRasterDlgKrn_U

Dim nRet As Integer

Private Sub Command1_Click()

 RasterFileDlg.Directory = "e:\images\"

   RasterFileDlg.Filter = "ALL|*.*|LEAD|*.cmp|JPEG|*.JPG"

   RasterFileDlg.DialogTitle = "Select a Directory Please"

   RasterFileDlg.EnableMethodErrors = False

   RasterFileDlg.ShowHelpButton = True

   nRet = RasterFileDlg.ShowDirectoryDlg(hWnd)

   If (nRet = 0 And RasterFileDlg.DialogStatus = DLG_OK) Then

       MsgBox RasterFileDlg.Directory

   End If

End Sub

Private Sub RasterFileDlg_DlgHelp(ByVal DlgFrom As Long, ByVal CtlID As Long)

   Select Case DlgFrom

   Case HELP_FILESASSOCIATION

      MsgBox "'Help from FilesAssociation dialog "

   Case HELP_OPEN

      MsgBox " Help from Open dialog"

   Case HELP_FILESASSOCIATION

      MsgBox "'Help from FilesAssociation dialog "

   Case HELP_SAVE

      MsgBox " Help from Save dialog "

   Case HELP_FILECONVERSION

      MsgBox " 'Help from FileConversion dialog "

   Case HELP_PRINTPREVIEW

      MsgBox " Help from PrintPreview dialog "

   Case HELP_PRINTSTITCHEDIMAGES

      MsgBox " Help from PrintStitchedImages dialog "

   End Select

End Sub

Private Sub Form_Load()

KrnDlg.InitDlg (INIT_WITH_COLOR)

Set RasterFileDlg = New LEADRasterDlgFile_U

LEAD1.Load "c:\test.bmp", 0, 1, 1

End Sub

//ImagDlg//

Dim WithEvents RasterImgDlg As LEADRasterDlgImg_U

Dim KrnDlg As New LEADRasterDlgKrn_U

Dim nRet As Integer

Private Sub Command1_Click()

   RasterImgDlg.EnableZoomToFit = False

   RasterImgDlg.BackColor = RGB(255, 0, 0)

   RasterImgDlg.Bitmap = LEAD1.Bitmap

   RasterImgDlg.UIFlags = ROTATE_SHOW_PREVIEW Or _

                               ROTATE_SHOW_BACKCOLOR Or _

                               ROTATE_SHOW_RESIZE

   

   RasterImgDlg.EnableMethodErrors = False

   RasterImgDlg.ShowHelpButton = True

   nRet = RasterImgDlg.ShowRotateDlg(hWnd)

   If (nRet = 0 And RasterImgDlg.DialogStatus = DLG_OK) Then

      LEAD1.Rotate RasterImgDlg.Angle, RasterImgDlg.RotateFlags, _

                   RasterImgDlg.BackColor

   End If

End Sub

Private Sub Form_Load()

KrnDlg.InitDlg (INIT_WITH_COLOR)

Set RasterImgDlg = New LEADRasterDlgImg_U

LEAD1.Load "c:\test.bmp", 0, 1, 1

End Sub

//ImageEfxDlg//

Dim WithEvents RasterImgEfxDlg As LEADRasterDlgImgEfx_U

Dim KrnDlg As New LEADRasterDlgKrn_U

Dim nRet As Integer

Private Sub Command1_Click()

  RasterImgEfxDlg.Bitmap = LEAD1.Bitmap

   RasterImgEfxDlg.EnableZoomToFit = True

   RasterImgEfxDlg.UIFlags = MOTIONBLUR_SHOW_PREVIEW + _

                             MOTIONBLUR_SHOW_TOOL_ZOOMLEVEL

   

   RasterImgEfxDlg.ShowHelpButton = True

   nRet = RasterImgEfxDlg.ShowMotionBlurDlg(hWnd)

   If (nRet = 0 And RasterImgEfxDlg.DialogStatus = DLG_OK) Then

   nRet = LEAD1.MotionBlur(RasterImgEfxDlg.Dimension, _

                                RasterImgEfxDlg.Angle, _

                                RasterImgEfxDlg.EnableUniDirectional)

   End If

End Sub

Private Sub RasterImgEfxDlg_DlgHelp(ByVal DlgFrom As Long, ByVal CtlID As Long)

   Select Case DlgFrom

   Case HELP_MOTIONBLUR

      MsgBox "Help from Motion Blur dialog"

   Case HELP_RADIALBLUR

      MsgBox "Help from Radial Blur dialog"

   End Select

End Sub

Private Sub Form_Load()

KrnDlg.InitDlg (INIT_WITH_COLOR)

Set RasterImgEfxDlg = New LEADRasterDlgImgEfx_U

LEAD1.Load "c:\test.bmp", 0, 1, 1

End Sub

//WebDlg//

Dim WithEvents RasterWebDlg As LEADRasterDlgWeb_U

Dim KrnDlg As New LEADRasterDlgKrn_U

Dim nRet As Integer

Private Sub Command1_Click()

  RasterWebDlg.TransparentColor = RGB(255, 255, 255)

   RasterWebDlg.PaletteType = CRP_FIXEDPALETTE

   RasterWebDlg.EnableWindowsColors = True

   RasterWebDlg.DitherType = CRD_FLOYDSTEINDITHERING

   RasterWebDlg.BitsPerPixel = 8

   RasterWebDlg.NumberOfColors = 256

   RasterWebDlg.TransparencyTolerance = 25

   RasterWebDlg.EnableTransparent = True

   RasterWebDlg.UIFlags = PNGWEBTUNER_SHOW_INFORMATION + _

                          PNGWEBTUNER_SHOW_PREVIEW + _

                          PNGWEBTUNER_SHOW_TOOL_ZOOMLEVEL + _

                          PNGWEBTUNER_SHOW_TOOL_COLORPICKER + _

                          PNGWEBTUNER_SHOW_TRANSPARENCY + _

                          PNGWEBTUNER_SHOW_ADDWINDOWCOLOR

   RasterWebDlg.Bitmap = LEAD1.Bitmap

   RasterWebDlg.ShowHelpButton = True

   RasterWebDlg.EnableZoomToFit = False

   nRet = RasterWebDlg.ShowPNGWebTunerDlg(hWnd)

   If (nRet = 0 And RasterWebDlg.DialogStatus = DLG_OK) Then

               LEAD1.ColorRes RasterWebDlg.BitsPerPixel, _

                                 RasterWebDlg.PaletteType, _

                                 RasterWebDlg.DitherType, _

                                 0

   End If

End Sub

'---------------------------------------------------------------------------

Private Sub RasterWebDlg_DlgHelp(ByVal DlgFrom As Long, ByVal CtlID As Long)

   Select Case DlgFrom

      Case HELP_PNGWEBTUNER

         MsgBox " Help from PNG Web Tuner dialog "

      

      Case HELP_GIFWEBTUNER

         MsgBox " Help from GIF Web Tuner dialog "

   

      Case HELP_JPEGWEBTUNER

         MsgBox " Help from JPEG Web Tuner dialog "

   

      Case HELP_HTMLMAPPER

         MsgBox " Help from HTMLMapper dialog "

      End Select

End Sub

Private Sub Form_Load()

KrnDlg.InitDlg (INIT_WITH_COLOR)

Set RasterWebDlg = New LEADRasterDlgWeb_U

LEAD1.Load "c:\test.bmp", 0, 1, 1

End Sub

//DocDlg//

Dim WithEvents RasterImgDocDlg As LEADRasterDlgImgDoc_U

Dim KrnDlg As New LEADRasterDlgKrn_U

Dim nRet As Integer

Private Sub Command1_Click()

KrnDlg.InitDlg (INIT_WITH_COLOR)

Set RasterImgDocDlg = New LEADRasterDlgImgDoc_U

' Make sure that you load 1-bit image

   LEAD1.Load "c:\test.tif", 1, 1, 1

   RasterImgDocDlg.EnableZoomToFit = False

 

   RasterImgDocDlg.UIFlags = 6

   RasterImgDocDlg.DotRemove.MinDotHeight = 6

   RasterImgDocDlg.DotRemove.MaxDotWidth = 8

   RasterImgDocDlg.DotRemove.MaxDotHeight = 8

   RasterImgDocDlg.DotRemove.Flags = DOT_USE_DIAGONALS Or DOT_USE_DPI

   

   RasterImgDocDlg.WhiteAreaColor = RGB(255, 0, 0)

   RasterImgDocDlg.BlackAreaColor = RGB(0, 0, 255)

   RasterImgDocDlg.UIFlags = DOTREMOVE_AUTOPROCESS Or _

                             DOTREMOVE_SHOW_PREVIEW Or _

                             DOTREMOVE_SHOW_TOOL_ZOOMLEVEL

   RasterImgDocDlg.Bitmap = LEAD1.Bitmap

   RasterImgDocDlg.ShowHelpButton = True

   nRet = RasterImgDocDlg.ShowDotRemoveDlg(hWnd)

   If (nRet = 0 And RasterImgDocDlg.DialogStatus = DLG_OK) Then

      LEAD1.DotRemove RasterImgDocDlg.DotRemove.Flags, RasterImgDocDlg.DotRemove.MinDotWidth, RasterImgDocDlg.DotRemove.MinDotHeight, RasterImgDocDlg.DotRemove.MaxDotWidth, RasterImgDocDlg.DotRemove.MaxDotHeight

   End If

End Sub

Private Sub RasterImgDocDlg_DlgHelp(ByVal DlgFrom As Long, ByVal CtlID As Long)

   Select Case DlgFrom

      Case HELP_SMOOTH

            MsgBox "Help from Smooth dialog"

      Case HELP_REMOVEREDEYE

        MsgBox "Help from Remove Red eye dialog"

      Case HELP_LINEREMOVE

         MsgBox "Help from Line-Remove dialog"

      Case HELP_BORDERREMOVE

         MsgBox "Help from Border-Remove dialog"

      Case HELP_INVERTEDTEXT

         MsgBox "Help from Inverted-Text dialog"

      Case HELP_DOTREMOVE

         MsgBox "Help from Dot-Remove dialog"

      Case HELP_HOLEPUNCHREMOVE

         MsgBox "Help from Hole-Punch-Remove dialog"

   End Select

End Sub