ShowAddBitmapsDlg example for C++ Builder

void __fastcall TForm1::ShowAddBitmapsDlg1Click(TObject *Sender) 
{
   L_INT i; 
   L_INT nRet; 
   AnsiString FileNames[3]= { "e:\\image1.jpg", "e:\\image2.jpg", "e:\\image3.jpg" };

   LEADImage1->EnableMethodErrors = False; 
   LEADDlgImgEffect1->ItemsCount = 3; 

   LEADImage2->Load ( FileNames[0], 0, 1, 1 ); 
   LEADDlgImgEffect1->ItemDescription [0]= IntToStr(0); 
   LEADDlgImgEffect1->ItemFileName [0]= FileNames[0]; 
   LEADDlgImgEffect1->ItemBitmap[0]= LEADImage2->Bitmap; 
   for ( i= 0; i < 3; i ++ ) 
   {
      LEADImage2->LoadStamp ( FileNames[i] ); 
      LEADDlgImgEffect1->ItemDescription [i]= IntToStr(i); 
      LEADDlgImgEffect1->ItemFileName [i]= FileNames[i]; 
      LEADDlgImgEffect1->ItemBitmap[i]= LEADImage2->Bitmap; 
   }

   LEADDlgImgEffect1->DlgFlags = DLG_ADDBITMAPS_SHOW_PREVIEW |
                                DLG_ADDBITMAPS_SHOW_TOOL_ZOOMLEVEL; 

   LEADDlgImgEffect1->LEADImage = LEADImage1; 
   nRet= LEADDlgImgEffect1->ShowAddBitmapsDlg ( this ); 
   if ( nRet == SUCCESS_DLG_OK ) 
   {
      if ( LEADDlgImgEffect1->SelectedBitmapList != NULL ) 
         LEADImage1->BitmapList= LEADDlgImgEffect1->SelectedBitmapList
   }