Pretty simple but I have used it on numerous occasions so I thought I may as well share:
SCAR Code:
{*******************************************************************************
function ColorsInBox(Color: TIntegerArray; x1, y1, x2, y2: Integer;): Boolean;
By: NCDS & Nava2
Description:Returns true if "Color" is found in box (x1, y1), (x2, y2).
*******************************************************************************}
function ColorsInBox(Color: TIntegerArray; x1, y1, x2, y2: Integer): Boolean;
var
tia: TIntegerArray; i, o: Integer;
begin
o := 0;
tia := GetColorsBox(x1, y1, x2, y2, True);
clearSameIntegers(tia);
clearSameIntegers(color);
for i := High(Color) downto 0 do
if InIntArray(tia, Color[i]) then
Inc(o);
Result := (o = Length(Color));
end;
Any thoughts on this?