Code:
'For DIM Image%(1 TO 30, 1 TO 100):
Image%(x%, y%) = whatever%
'For DIM Image%(1 TO 3000):
Image%( (y%-1) * 30 + (x%-1) + 1 ) = whatever%
Just replace the number 30 with the width of the image.
Also, it makes things easier if you start off with 0 instead of 1:
Code:
'For DIM Image%(29, 99):
Image%(x%, y%) = whatever%
'For DIM Image%(2999):
Image%( y% * 30 + x% ) = whatever%
And then there's the fact that GET and PUT pack 2 pixels into one integer. The best way to do that is with POKE (in this example the top left is 0,0 not 1,1):
Code:
DEF SEG = Image%(0)
POKE y% * 30 + x%, whatever%
And now the final example. Here we account for the fact the GET and PUT store the image's width and height in the first 2 integers. Actually, the first integer is the width times 8, which never made any sense the me. The second integer is just the height. Anyway:
Code:
Image%(0) = 30 * 8 ' substitute 30 for image's width
Image%(1) = 100 ' substitute 100 for image's height
DEF SEG = VARSEG(Image%(0))
POKE 4 + y% * 30 + x%, whatever%
The "4 + " part in the POKE command skips over the first 2 integers, the width and height.