ImageEn, unit imageenproc

TImageEnProc.CastColorRange

TImageEnProc.CastColorRange


Declaration

procedure CastColorRange(BeginColor, EndColor, CastColor: TRGB); overload;
procedure CastColorRange(BeginColor, EndColor, CastColor: TColor); overload;


Description

Set all colors in the range BeginColor to EndColor to CastColor.

Note: Ensure BeginColor <= EndColor, i.e. BeginColor is a darker color (Black is 0,0,0) and EndColor a lighter color (white is 255, 255, 255).


Example

// Change all gray levels from 50 to 100 to black
var
  BeginColor, EndColor, CastColor: TRGB;
Begin
  BeginColor := CreateRGB(50, 50, 50);
  EndColor := CreateRGB(100, 100, 100);
  CastColor := CreateRGB(0, 0, 0);
  ImageEnView1.Proc.CastColorRange(BeginColor, EndColor, CastColor);
End;


See Also

- CreateRGB
- TRGB2TColor
- TColor2TRGB