12-08-2005, 02:33 PM
alright i'm quite tired of all this, though i'm sure it's just me overlooking something.
now the trouble is ImageArray is completely empty from index 1 onward. the filename i provide is correct, and numImages shows the correct number. ImageArray(1) should be the same as numImages, a header. ImageArray(2) should have the width of the image. but it's all zeros! blimey!
(this is the latest fbc.)
i have also tried changing the datatype from byte to ubyte to integer and adjusting my code. is it just way too late at night or what exactly is wrong with bload?
i should mention the way the data was outputted, in case bload chokes on multiple datatypes or something? the number of images header is a two-byte integer, followed by two more integers for image width *8, image height. then proceeds byte after byte of image data. two-byte integers should still bload as seperate bytes into the array... they used to in QB, anyway.
Code:
function LoadImageData (filename$, ImageArray() as byte)
ff = FREEFILE
OPEN filename$ FOR BINARY AS #ff
Byts& = (LOF(ff))
get #ff,,numImages
CLOSE #ff
REDIM ImageArray(1 TO Byts&)
bload filename$, VarPtr(ImageArray(1))
print filename$
print " imgs: "; numImages; " byts: "; Byts&
print ImageArray(1), ImageArray(2), ImageArray(3)
return numImages
end function
now the trouble is ImageArray is completely empty from index 1 onward. the filename i provide is correct, and numImages shows the correct number. ImageArray(1) should be the same as numImages, a header. ImageArray(2) should have the width of the image. but it's all zeros! blimey!
(this is the latest fbc.)
i have also tried changing the datatype from byte to ubyte to integer and adjusting my code. is it just way too late at night or what exactly is wrong with bload?
i should mention the way the data was outputted, in case bload chokes on multiple datatypes or something? the number of images header is a two-byte integer, followed by two more integers for image width *8, image height. then proceeds byte after byte of image data. two-byte integers should still bload as seperate bytes into the array... they used to in QB, anyway.
mrToad | dannywilfong.com | Alvarian Tales