ShowLineRemoveDlg example for Delphi

procedure TForm1.ShowLineRemoveDlg1Click(Sender: TObject); 
var
   nRet: L_INT; 
begin

   LEADDlgImgDoc1.GapLength:= 3; 
   LEADDlgImgDoc1.MaxLineWidth:= 9; 
   LEADDlgImgDoc1.MaxWallPercent:= 10; 
   LEADDlgImgDoc1.MinLineLength:= 400; 
   LEADDlgImgDoc1.Variance:= 3; 
   LEADDlgImgDoc1.Wall:= 15; 
   LEADDlgImgDoc1.ModificationColor:= RGB ( 0, 255, 0 ); 
   LEADDlgImgDoc1.ProcessFlags:= LINE_USE_DPI Or LINE_USE_VARIANCE; 
   LEADDlgImgDoc1.RemoveFlags:= LINEREMOVE_VERTICAL; 
   LEADDlgImgDoc1.DlgFlags:= DLG_LINEREMOVE_SHOW_PREVIEW Or
                              DLG_LINEREMOVE_SHOW_TOOL_ZOOMLEVEL; 

   LEADDlgImgDoc1.LEADImage:= LEADImage1; 
   nRet:= LEADDLgImgDoc1.ShowLineRemoveDlg ( Self ); 
   if ( nRet = SUCCESS_DLG_OK ) then
   begin
      LEADImage1.FreeRgn ( ); 
      LEADImage1.SetRgnHandle ( LEADDlgImgDoc1.DocCleanRgn, 0, 0, L_RGN_SET ); 
      LEADDLgImgDoc1.DocCleanRgn:= 0;{no longer need rgn}
      LEADImage1.RgnFrameType:= ftAnimated; 
   end; 
end;