FindBitmapTolerance

From SCAR Divi Manual
Jump to: navigation, search

Definition

function FindBitmapTolerance(Bitmap: Integer; var x, y: Integer; Tol: Integer): Boolean;

Availability

SCAR Divi 3.00 > Current

Description

Searches the entire selected client window for a given bitmap associated with the index given by Bmp in the bitmap resource manager within a tolerance range specified by Tol. If the bitmap is found, the function returns true and the coordinates where it found the bitmap in x and y. If the bitmap was not found, it returns false. The active tolerance algorithm can be changed using the ColorToleranceSpeed function.

Example

var
  b, x, y: Integer;

begin
  b := BitmapFromString(1, 1, '');
  CopyClientToBitmap(b, 26, 85, 40, 100);
  FindBitmapTolerance(b, x, y, 5);
  WriteLn(IntToStr(x) + ', ' + IntToStr(y));
end.

Output:

25, 85

See Also