Procedure TIntegerArrayExample;
var
ColorArray: TIntegerArray; //Declares var as TIntegerArray
ColorsFound: Array of TPointArray; //Also known as T2DPointArray, Is an array containing multiple arrays
i, x, y: integer;
begin
ColorArray := [0, 1, 2, 3]; //Loads the array of Colors
setLength(ColorsFound,Length(ColorArray)); //Reserves space so that every color got its own TPointArray
for i := 0 to High(ColorArray)do //Cycles through the Color Array
begin
FindColorsTolerance(ColorsFound[i], ColorArray[i], MSX1, MSY1, MSX2, MSY2, 5); //FindColor!
end;
print(ColorsFound);
end;
Coult print something like:
[[[0,0],[2,3],[1,3]], //Points with color 0, ColorsFound[0]
[[1,0],[3,3]], //Points with color 1, ColorsFound[1]
[[0,1],[4,3],[4,4]], //Points with color 2, ColorsFound[2]
[[1,1],[1,3]]] //Points with color 3, ColorsFound[3]