Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 32 lines (26 sloc) 1.053 kB
program FindColorTolerance_Example;
var
Bounds: TBox;
x, y, Colour, Tolerance: Integer;
begin
Colour := clBlack; // The colour to search for (e.g clBlack OR 0)
Tolerance := 16; // The tolerance to search for.
// Tolerance is the amount of similarity it should search for colours with
// the highest tolerance you can use is 255.
Bounds.X1 := 0; // The top left corner
Bounds.Y1 := 0; // - of the client.
Bounds.X2 := 400; // The bottom right corner
Bounds.Y2 := 400; // - of the client.
// If the colour was found, do what?
if(FindColorTolerance(x, y, Colour, Bounds.X1, Bounds.Y1, Bounds.X2, Bounds.Y2, Tolerance)) then
begin
Writeln('The colour, ' + IntToStr(Colour) + ' and similar, were found :-)');
// FindColorTolerance stores the location of the colour in variables 'x' and 'y'.
Writeln('It was found at:');
Writeln(' X = ' + IntToStr(X));
Writeln(' Y = ' + IntToStr(Y));
end else
begin
Writeln('The colour was not found :-(');
end;
end.
Jump to Line
Something went wrong with that request. Please try again.