ShowContourFilterDlg example for Delphi

procedure TForm1.ShowContourFilterDlg1Click(Sender: TObject); 
var
   nRet: L_INT; 
begin
   LEADDlgImgEffect1.MaxError:= 5; 
   LEADDlgImgEffect1.DeltaDirection:= 5; 
   LEADDlgImgEffect1.Option:= CONTOUR_LINK_COLOR; 
   LEADDlgImgEffect1.Threshold:= 5; 
   LEADDlgImgEffect1.OptionFlags:= DLG_CONTOURFILTER_SHOW_OPTION_ALL; 
   LEADDlgImgEffect1.DlgFlags:= DLG_CONTOURFILTER_SHOW_PREVIEW Or
                              DLG_CONTOURFILTER_SHOW_DELTADIRECTION Or
                              DLG_CONTOURFILTER_SHOW_MAXIMUMERROR Or
                              DLG_CONTOURFILTER_SHOW_OPTION Or
                              DLG_CONTOURFILTER_SHOW_THRESHOLD Or
                              DLG_CONTOURFILTER_SHOW_TOOL_ZOOMLEVEL; 

   LEADDlgImgEffect1.LEADImage:= LEADImage1; 

   nRet:= LEADDlgImgEffect1.ShowContourFilterDlg ( Self ); 
   if ( nRet = SUCCESS_DLG_OK ) then
   begin
      LEADImage1.ContourFilter (LEADDlgImgEffect1.Threshold
                                 LEADDlgImgEffect1.DeltaDirection
                                 LEADDlgImgEffect1.MaxError
                                 LEADDlgImgEffect1.Option ); 
   end; 
end;