AutoColorLevel example for Delphi
procedure TForm1.AutoColorLevel1Click(Sender: TObject);
var
Master: LEVELCOLORINFO;
Red: LEVELCOLORINFO;
Green: LEVELCOLORINFO;
Blue: LEVELCOLORINFO;
begin
{ Apply "Auto Leveling" to the bitmap }
LEADImage1.AutoColorLevel( Master, Red, Green, Blue, DEFAULT_BLACK_CLIP, DEFAULT_WHITE_CLIP, AUTO_LEVEL );
ShowMessage ( 'Min and Max input values for the' + 'blue channel using auto level are ' + IntToStr(Blue.uMinInput) + 'and ' + IntToStr(Blue.uMaxInput) );
end;