ShowHalftoneDlg example for C++ Builder

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

   LEADDlgColor1->ItemsCount = 3; 

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

   LEADDlgColor1->Angle = 5; 
   LEADDlgColor1->Dimension = 5; 
   LEADDlgColor1->HalftoneType = HT_RECT; 
   LEADDlgColor1->DlgFlags = DLG_HALFTONE_SHOW_PREVIEW |
                            DLG_HALFTONE_SHOW_TOOL_ZOOMLEVEL |
                            DLG_HALFTONE_SHOW_TOOL_SHOWEFFECT |
                            DLG_HALFTONE_SHOW_TOOL_ONSCREEN |
                            DLG_HALFTONE_SHOW_TOOL_RESET; 

   LEADDlgColor1->LEADImage = LEADImage1; 
   nRet= LEADDlgColor1->ShowHalftoneDlg ( this ); 
   if ( nRet == SUCCESS_DLG_OK ) 
   {
      ShowMessage ( "No of Selected Items are " + IntToStr(LEADDlgColor1->SelectedBitmapsCount) ); 
      if ( LEADDlgColor1->SelectedBitmapList != 0 ) 
         LEADImage1->BitmapList= LEADDlgColor1->SelectedBitmapList
   }
}