ContourFilter example for Visual Basic

Dim WithEvents LEADDlg1 As LEADRasterDlgImgEfx_U

Dim KrnDlg As New LEADRasterDlgKrn_U

Private Sub Command1_Click()

   

   LEADDlg1.UIFlags = CONTOURFILTER_SHOW_PREVIEW + CONTOURFILTER_SHOW_OPTION + CONTOURFILTER_SHOW_THRESHOLD + _

                      CONTOURFILTER_SHOW_DELTADIRECTION + CONTOURFILTER_SHOW_MAXIMUMERROR + CONTOURFILTER_SHOW_CONTEXTHELP

   

   LEADDlg1.ContourOptionFlags = CONTOURFILTER_SHOW_OPTION_THIN + CONTOURFILTER_SHOW_OPTION_LINK_BW + CONTOURFILTER_SHOW_OPTION_LINK_GRAY + _

                                 CONTOURFILTER_SHOW_OPTION_LINK_COLOR + CONTOURFILTER_SHOW_OPTION_APPROX_COLOR

                         

   LEADDlg1.Bitmap = LEAD1.Bitmap

   LEADDlg1.ShowContourFilterDlg hWnd

   LEADDlg1.Bitmap = 0

   LEAD1.ContourFilter LEADDlg1.Threshold, LEADDlg1.DeltaDirection, LEADDlg1.MaxError, LEADDlg1.ContourOption

End Sub

Private Sub Form_Load()

KrnDlg.InitDlg (INIT_WITH_COLOR)

Set LEADDlg1 = New LEADRasterDlgImgEfx_U

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

End Sub