ShowLocalHistoEqualizeDlg example for Delphi

procedure TForm1.ShowLocalHistoEqualizeDlg1Click(Sender: TObject); 
var
   nRet: L_INT; 
begin
   LEADDlgColor1.RectWidth:= Trunc ( LEADImage1.BitmapWidth / 2 ); 
   LEADDlgColor1.RectHeight:= Trunc ( LEADImage1.BitmapHeight / 2 ); 
   LEADDlgColor1.ColorSpace:= YUV_SPACE; 
   LEADDlgColor1.DlgFlags:= DLG_LOCALHISTOEQUALIZE_SHOW_PREVIEW Or
                             DLG_LOCALHISTOEQUALIZE_SHOW_TOOL_ZOOMLEVEL; 
   LEADDlgColor1.LEADImage:= LEADImage1; 
   LEADDlgColor1.LEADDlgService:= LEADDlgService1; 
   nRet:= LEADDlgColor1.ShowLocalHistoEqualizeDlg ( Self ); 
   if ( nRet = SUCCESS_DLG_OK ) then
   begin
      LEADImage1.LocalHistoEqualize ( LEADDlgColor1.RectWidth
                                      LEADDlgColor1.RectHeight
                                      LEADDlgColor1.XExtension
                                      LEADDlgColor1.YExtension
                                      LEADDlgColor1.ColorSpace
                                      LEADDlgColor1.SmoothSize ); 
   end; 
end;