Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
bitmap question
#1
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
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#2
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).
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply
#3
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.......

:|
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#4
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.
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply
#5
At least, that's what my documentation says and it works when I do it.
ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Reply
#6
eep. you're right. i assumed bmps were created by people without dyslexia.
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply
#7
:lol:
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#8
I'll try to implement this...
(edit) soon...
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#9
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
Reply
#10
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.
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)