I'm writing procedure that rewrites bitmap to array on XE7. I wrote this piece of code:
PROCEDURE BitmapToArray(var inBitmap : TBitMap;
var outArray : TIntegerDynArray_2D);
var
x : integer;
y : integer;
P : PByteArray;
begin
SetLength(outArray,0,0);
SetLength(outArray, inBitmap.Height, inBitmap.Width);
for y := 0 to inBitmap.Height-1 do
begin
P := inBitmap.ScanLine[y];
for x := 0 to inBitmap.Width-1 do
begin
outArray[y,x]:=P[x];
end;
end;
end;
But it doesn't work, array is filled with zeros.
Bitmap: