ShowIntensityDetectDlg example for Delphi

procedure TForm1.ShowIntensityDetectDlg1Click(Sender: TObject); 
var
   nRet: L_INT; 
begin
   LEADDlgColor1.DlgFlags:= DLG_INTENSITYDETECT_SHOW_PREVIEW Or
                             DLG_INTENSITYDETECT_SHOW_TOOL_ZOOMLEVEL; 

   LEADDlgColor1.LEADImage:= LEADImage1; 
   LEADDlgColor1.LEADDlgService:= LEADDlgService1; 
   nRet:= LEADDlgColor1.ShowIntensityDetectDlg ( Self ); 
   if ( nRet = SUCCESS_DLG_OK ) then
   begin
      LEADImage1.IntensityDetect ( LEADDlgColor1.IntensityLow
                                   LEADDlgColor1.IntensityHigh
                                   LEADDlgColor1.IntensityInColor
                                   LEADDlgColor1.IntensityOutColor
                                   LEADDlgColor1.Channel ); 
   end; 
end;