Qbasicnews.com

Full Version: bitmap question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
My map consists of Y lines each of length X. Each line is made up of the ASCII characters 1, 2, or 6.
I think this is how information is stored in a bitmap, but there is also a header, right? How do I add in the extra information to it to make it a bitmap?

I kinda feel guilty posting this in two Forums:
http://www.neozones.com/Board/Messages/35782.shtml
an uncompressed bitmap also pads the side of the image so the width is a multiple of 4. and i think it may go bottom to top but i dont remember. you can find the format of a bmp file anywhere, but particularly at WOTSIT.ORG (you can save and load it with a simple type structure).
Kill me. Now.

I am lost. Are there any *easy-to-read* QB screen to bitmap loaders available? I can just load the array and replace the screen info with my array info.......

:|
aw, c'mon buddy, you gotta *try*... here:

TYPE bmpheader
bftype AS STRING * 2
bfSize AS LONG
bfReserved1 AS INTEGER
bfReserved2 AS INTEGER
bfOffBits AS LONG
biSize AS LONG
biwidth AS LONG
biheight AS LONG
biPlanes AS INTEGER
bibitcount AS INTEGER
bicompression AS LONG
biSizeImage AS LONG
biXPelsPerMeter AS LONG
biYPelsPerMeter AS LONG
biClrUsed AS LONG
biClrImportant AS LONG
END TYPE

the palette, assuming you have one, is next, it's 1024 characters. that's this pattern, over and over:

blue, green, red, null

256 times over. they range from 0-255 so from qb you have to multiply by 4.0476 before you lay it down. then jump to position 1079 and lay down your pixels from left to right, bottom to top. if the width isnt a multiple of 4, then pad the sides with null pixels until it is.
At least, that's what my documentation says and it works when I do it.
eep. you're right. i assumed bmps were created by people without dyslexia.
:lol:
I'll try to implement this...
(edit) soon...
HAR 13h++ has routines for loading fullscreen BMP's (uncompressed). WinkBig Grin

However, when you want to load not-full-screen BMP's the BMP file is different from a 320x200 BMP. All data is moved up 1 or more bytes Smile
Quote:At least, that's what my documentation says and it works when I do it.

Yeah, it took me a while to make a BMP saver because of the dyslexic way they store the palette.