GetStatisticsInfo example for Delphi
procedure TForm1.Button1Click(Sender: TObject);
var
dStdDev: L_DOUBLE;
dMean: L_DOUBLE;
nMedian: L_INT;
nMax: L_INT;
nMin: L_INT;
uPixelCnt: L_UINT;
uTotalPixelCnt: L_UINT;
dPercent: L_DOUBLE;
nRet: L_INT;
begin
{ Load a bitmap at 24 bits per pixel }
LEADImage1.Load(‘image1.cmp', 0, 1, 1);
{ Get statistical image information }
nRet:= LEADImage1.GetStatisticsInfo(CHANNEL_MASTER, 0, 255, dStdDev, dMean, nMedian, nMax, nMin, uPixelCnt, uTotalPixelCnt, dPercent);
if(nRet = SUCCESS)then
begin
ShowMessage('Standard deviation value = ' + FloatToStr(dStdDev) + Chr(13) + 'Mean value = ' + FloatToStr(dMean)+ Chr(13) + 'Median value = ' + IntToStr(nMedian)+ Chr(13) + 'Maximum value = ' + IntToStr(nMax)+ Chr(13) + 'Minimum value = ' + IntToStr(nMin)+ Chr(13) + 'Pixel number value = ' + IntToStr(uPixelCnt)+ Chr(13) + 'Whole image Pixel number value = ' + IntToStr(uTotalPixelCnt) + Chr(13) + 'Percent value = ' + FloatToStr(dPercent) + Chr(13));
end;
end;