Via http://alleg.sourceforge.net/onlinedocs/en/datafile.html
DAT_BITMAP =
DAT_C_SPRITE =
DAT_XC_SPRITE =
16 bit - <bits> - bitmap color depth
16 bit - <width> - bitmap width
16 bit - <height> - bitmap height
var - <data> - bitmap data
What is var for bitmap data supposed to be? A BITMAP structure or just the bytes that make up the bitmap.
I think it's the raw data for each scanline one after the other, but why don't you check the code in allegro/tools/plugins/datimage.c?
Didn't know to look there. It looks like it is the raw image data
| 1 | pack_mputw(depth, f); |
| 2 | pack_mputw(bmp->w, f); |
| 3 | pack_mputw(bmp->h, f); |
| 4 | |
| 5 | switch (depth) { |
| 6 | case 16: |
| 7 | /* hicolor */ |
| 8 | for (y=0; y<bmp->h; y++) { |
| 9 | p16 = (uint16_t *)bmp->line[y]; |
| 10 | |
| 11 | for (x=0; x<bmp->w; x++) { |
| 12 | c = p16[x]; |
| 13 | r = getr_depth(depth, c); |
| 14 | g = getg_depth(depth, c); |
| 15 | b = getb_depth(depth, c); |
| 16 | c = ((r<<8)&0xF800) | ((g<<3)&0x7E0) | ((b>>3)&0x1F); |
| 17 | pack_iputw(c, f); |
| 18 | } |
| 19 | } |
| 20 | break; |
Now I just have to figure out a way to do this in VB.NET. The way I'm doing it must be incorrect as the image looks all messed up in the grabber.