ImageEn, unit imageenview

TImageEnView.SelectColors

TImageEnView.SelectColors


Declaration

procedure SelectColors(StartColor, EndColor: TRGB; Op: TIESelOp = iespReplace);
procedure SelectColors(Color: TRGB; Op: TIESelOp = iespReplace);
procedure SelectColors(ColorIndex: integer; Op: TIESelOp = iespReplace);


Description

Selects all colors inside the range StartColor up to EndColor, or specific color or a color index.
If Op is iespReplace the region replaces the existing selection, otherwise if Op is iespAdd, the region is appended to the existing selection.

Third overload accepts ColorIndex, which is the index of a color in image colormap: the bitmat pixelformat must be ie8p (palette).

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).
 A bitmap/non-vector selection is used. You can use IsPointInsideSelection to determine whether specific pixels are selected


Example

// select from 200,200,200 to 255,255,255
ImageEnView1.SelectColors(CreateRGB(200, 200, 200), CreateRGB(255, 255, 255));

// select only color 255,0,0 (pure red)
ImageEnView1.SelectColors(CreateRGB(255, 0, 0));

// select color index 5 of a paletted bitmap (ie8p)
ImageEnView1.SelectColors(5);


See Also

 SelectNonAlpha
 SelectionIntensity
 CreateRGB
 TRGB2TColor
 TColor2TRGB