ColorLevel example for Delphi
procedure TForm1.ColorLevel1Click(Sender: TObject);
var
Master: LEVELCOLORINFO;
Red: LEVELCOLORINFO;
Green: LEVELCOLORINFO;
Blue: LEVELCOLORINFO;
begin
// Master will cause the image to be Inversed
Master.uMinInput:= 0;
Master.uMaxInput:= 255;
Master.uMinOutput:= 255;
Master.uMaxOutput:= 0;
Master.uGamma:= DEFAULT_GAMMA;
Red.uMinInput:= 0;
Red.uMaxInput:= 255;
Red.uMinOutput:= 255;
Red.uMaxOutput:= 0;
Red.uGamma:= DEFAULT_GAMMA;
Green.uMinInput:= 0;
Green.uMaxInput:= 255;
Green.uMinOutput:= 255;
Green.uMaxOutput:= 0;
Green.uGamma:= DEFAULT_GAMMA;
Blue.uMinInput:= 20;
Blue.uMaxInput:= 200;
Blue.uMinOutput:= 0;
Blue.uMaxOutput:= 255;
Blue.uGamma:= DEFAULT_GAMMA;
{ Level the Blue and Master channels }
LEADImage1.ColorLevel( Master, Red, Green, Blue, LEVEL_BLUE + LEVEL_MASTER );
end;