ShowSmoothDlg example for C++ Builder

void __fastcall TForm1::ShowSmoothDlg1Click(TObject *Sender) 
{
   L_INT nRet; 
   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 |
                              DLG_SMOOTH_SHOW_TOOL_ZOOMLEVEL; 

   LEADDlgImgDoc1->LEADImage= LEADImage1; 
   LEADDlgImgDoc1->ShowSmoothDlg ( this ); 
   if ( nRet == SUCCESS_DLG_OK ) 
   {
        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; 
   }
}