Here is the code
procedure DrawPicture(x, y : Integer; img : Pointer);
var x1, y1 : Integer;
temp : array of array of Integer;
begin
temp := @img;
for x1:=Low(temp) to High(temp) do
begin
for y1:=Low(temp) to High(temp[0]) do
begin
ScaledPixel(x1 * SCALE + x, y1 * SCALE + y, temp[x1, y1], SCALE);
end;
end;
Pointer(temp) := Nil;
end;
The main issue here is that an
array of array of X is on the first level an
array of Pointer. So you can't simply convert a flat two dimensional array of values to such an array, because then the variable would interpret the values inside the first array as pointers to the sub arrays.