@TheComet
Are you trying to create DATA statements of the color information from a bitmap? Or are you just trying to store all the bytes of a bitmap file into an array, so you can later write the array back to a file and it will be that bitmap? If you want to store the entire bitmap inside your code as data statements then just read the bitmap in and write out each byte in a string as data statments. Maybe 20 to 40 values per line:
data 0,0,2,0,0,45,0,0 etc Then you can include the data statements in your program. All you'd have to do is read the data and write each byte back to a file, then load the file as a bitmap or image.
If you want just the color data, if your plan is to later do something like INK color,0 dot x,y you can read the color data from the bitmap file. It can be tricky because the bitmap starts with a 54 byte header then it's followed by color data. Depending on whether the bit depth is 8,16,24, or 32 bit, the color data may be padded. This means there are extra zeros at the end of each line across the bitmap. This is so the width of each line as it's stored falls neatly into a 4 byte divisible scanline.
You'll want to look up the bmp file format so you can see what the elements of the header are.
Basically the method for extracting the color data is:
1. get the file size
2. subtract 54 from the file size. This is the size of your color data so DIM array(this size)
3. calculate the padding (the extra zeros that will appear per xacross) subtract this from your bitmap width
4. open the file to read
5. read through the first 54 bytes
6. starting with byte 55, start reading the bytes of your colors until you reach the padding
7. skip the number of bytes for padding
8. start reading the next line of color
9. when file end is reached, close file
If you look through the DBC challenges, this is the method I used to create 3d matrix text. It's quite fast. Bascially, I take a line of text that the user types, each letter is saved as a bitmap then read back in and converted to a mini matrix by reading the color data.
Enjoy your day.