ShowLocalHistoEqualizeDlg example for C++ Builder

void __fastcall TForm1::ShowLocalHistoEqualizeDlg1Click(TObject *Sender) 
{
   L_INT nRet; 

   LEADDlgColor1->RectWidth = LEADImage1->BitmapWidth / 2; 
   LEADDlgColor1->RectHeight = LEADImage1->BitmapHeight / 2; 
   LEADDlgColor1->ColorSpace = YUV_SPACE; 
   LEADDlgColor1->DlgFlags = DLG_LOCALHISTOEQUALIZE_SHOW_PREVIEW |
                           DLG_LOCALHISTOEQUALIZE_SHOW_TOOL_ZOOMLEVEL; 
   LEADDlgColor1->LEADImage = LEADImage1; 
   LEADDlgColor1->LEADDlgService = LEADDlgService1; 
   nRet= LEADDlgColor1->ShowLocalHistoEqualizeDlg ( this ); 
   if ( nRet == SUCCESS_DLG_OK ) 
   {
      LEADImage1->LocalHistoEqualize ( LEADDlgColor1->RectWidth
                                      LEADDlgColor1->RectHeight, 
                                      LEADDlgColor1->XExtension
                                      LEADDlgColor1->YExtension
                                      LEADDlgColor1->ColorSpace
                                      LEADDlgColor1->SmoothSize ); 
   }
}