ShowSmoothDlg example for Delphi

procedure TForm1.ShowSmoothDlg1Click(Sender: TObject); 
var
   nRet: L_INT; 
begin
   LEADDlgImgDoc1.ProcessFlags:= SMOOTH_ALLFLAGS; 
   LEADDlgImgDoc1.Length:= 1; 
   LEADDlgImgDoc1.WhiteAreaColor:= RGB ( 255, 0, 0 ); 
   LEADDlgImgDoc1.BlackAreaColor:= RGB ( 0, 0, 255 ); 
   LEADDlgImgDoc1.DlgFlags:= DLG_SMOOTH_SHOW_PREVIEW Or
                              DLG_SMOOTH_SHOW_TOOL_ZOOMLEVEL; 

   LEADDlgImgDoc1.LEADImage:= LEADImage1; 
   nRet:= LEADDlgImgDoc1.ShowSmoothDlg ( Self ); 
   if ( nRet = SUCCESS_DLG_OK ) then
   begin
        LEADImage1.FreeRgn ( ); 
        LEADImage2.Bitmap:= LEADDlgImgDoc1.DocCleanBitmap;
        LEADImage1.SetRgnHandle ( LEADImage2.GetRgnHandle, 0, 0, L_RGN_SET ); 
        LEADImage2.Bitmap:= 0; {no longer need copy}
        LEADDlgImgDoc1.DocCleanBitmap:= 0; {no longer need rgn either}
        LEADImage1.RgnFrameType:= ftAnimated; 
   end; 
end;