SimilarBitmapsEx

From SCAR Divi Manual
Revision as of 18:36, 12 February 2012 by Freddy (talk | contribs) (Created page with "==Definition== <source lang="scar" lines="false"> function SimilarBitmapsEx(const Bmp1, Bmp2, Tol: Integer; out Diff: TPointArray): Boolean; </source> ==Availability== SCAR Div...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Definition

function SimilarBitmapsEx(const Bmp1, Bmp2, Tol: Integer; out Diff: TPointArray): Boolean;

Availability

SCAR Divi 3.30 > Current

Description

This function returns true if all pixels of 2 given bitmaps specified by Bmp1 and Bmp2 are within the tolerance range of each other specified by Tol. This is determined using the active tolerance algorithm which can be changed with ColorToleranceSpeed. If the functions returns false, it will fill up the TPointArray TPA with the coordinates of all pixels that did not match in case that the bitmaps were of equal size.

Example

var
  b1, b2: Integer;
  TPA: TPointArray;

begin
  b1 := BitmapFromString(100, 100, '');
  b2 := BitmapFromString(100, 100, '');
  if not SimilarBitmapsEx(b1, b2, 5, TPA) then
    WriteLn(TPAToStr(TPA));
  FastSetPixel(b1, 5, 5, 255);
  if not SimilarBitmapsEx(b1, b2, 5, TPA) then
    WriteLn(TPAToStr(TPA));
end.

Output:

(5,5)

See Also