I have problem with that.
Code:=
function BGFDisplayToBGFImage(BGFDisplay:TBGFDisplay):TBGFImage;
var tmpImage:TBGFImage;
var xLen,yLen,x,y:Integer;
begin
xLen:=Length(BGFDisplay);
if xLen>0 then yLen:=Length(BGFDisplay[0]) else begin
Application.MessageBox('Malformed BGFDisplay!','Error',MB_OK + MB_ICONERROR);
tmpImage.columns:=-1;
Result:=tmpImage;
exit;
end;
tmpImage.columns:=xLen;
tmpImage.rows:=ylen;
SetLength(tmpImage.data,xlen*ylen);
for x:=0 to xlen-1 do begin
for y:=0 to ylen-1 do begin
tmpImage.data[y+x]:=BGFDisplay[x,y];
end;
end;
Result:=tmpImage;
end;
TBGFDisplay is open (2d) array.
For 3x3 of it with following values:
0,1,2,
3,4,5,
6,7,0buffer should look like that:
0,1,2,3,4,5,6,7,0Instead with my code it looks like that
0,1,2,5,0,0,0,0,0.
Can you help me?