02-10-2005, 01:28 PM
Ok, more fun for you. It might just be me being totally silly, though.
Ok, I'm doing something a little arcane. I'm trying to BLOAD data from the file into an array. This works ok, except I have to be tricky by having to declare the array to be unsigned short and and manually hack the first two elements in order to have PUT properly display the image. Ok. That works.
Now, when I try to be clever and create a type, such as
FB makes it most of the way through the program, which essentially only declares a variable of type FB_IMAGE, BLOADS it into FB_IMAGE.imageData(0), sets width and height properly, and then tries to PUT it somewhere. I'll list the code at the end of this message.
The problem occurs with PUT. When I try to PUT the image, PUT complains about not being given an identifier. Except I am giving it an identifier. I essentially give it PUT (x,y), @FB_IMAGE. Since this should technically be a pointer to some data, hopefully in the format PUT expects, should that cause it any problems? Does it matter that LEN(FB_IMAGE) = 64005 rather than the expected 64004?
Actually, it completely hates anything besides a regular array, I tried arguments like testimg.imageData (passing the name of the array itself), testimg.imageData(0) (The array name more or less the way it likes), testimg (without the at-sign, maybe it would have taken that, I thought). None of them worked. Maybe you've got some ideas.
Ok, I'm doing something a little arcane. I'm trying to BLOAD data from the file into an array. This works ok, except I have to be tricky by having to declare the array to be unsigned short and and manually hack the first two elements in order to have PUT properly display the image. Ok. That works.
Now, when I try to be clever and create a type, such as
Code:
TYPE FB_IMAGE
height AS SHORT
width AS SHORT
imageData(64000) AS BYTE
END TYPE
FB makes it most of the way through the program, which essentially only declares a variable of type FB_IMAGE, BLOADS it into FB_IMAGE.imageData(0), sets width and height properly, and then tries to PUT it somewhere. I'll list the code at the end of this message.
The problem occurs with PUT. When I try to PUT the image, PUT complains about not being given an identifier. Except I am giving it an identifier. I essentially give it PUT (x,y), @FB_IMAGE. Since this should technically be a pointer to some data, hopefully in the format PUT expects, should that cause it any problems? Does it matter that LEN(FB_IMAGE) = 64005 rather than the expected 64004?
Code:
SCREEN 13, 8, 1, 1
CLS
TYPE FB_IMAGE field = 1
width as USHORT
height as USHORT
imageData(64000) as BYTE
END TYPE
DIM testimg AS FB_IMAGE
BLOAD "image.raw", @testimg.imageData(0) ''Load a full screen image
testimg.width = 320*8 ''Image is 320 pixels wide at 8bpp
testimg.height = 200 ''Image is 200 pixels tall
PUT (50,100), @testimg ''PUT really seems to hate anything besides regular arrays.
Actually, it completely hates anything besides a regular array, I tried arguments like testimg.imageData (passing the name of the array itself), testimg.imageData(0) (The array name more or less the way it likes), testimg (without the at-sign, maybe it would have taken that, I thought). None of them worked. Maybe you've got some ideas.