Page 1 of 2

BMP's in gwbasic

Posted: Mon Jul 26, 2004 2:27 pm
by Enigma...
Don't ask why... but I'm trying to get a BMP or some other windows image in GW-BASIC.
Is there any way to do it? It doesn't have to look smashing but a 256 color picture would be nice.
The problem is... I can't get my screen 13 to work. That would be a nice start if it would.

Can you guys help me out?

greetings from holland

Posted: Wed Jul 28, 2004 12:03 am
by barok_unlogged
why bother with gw basic? Use qbasic... Much better. Or even Visual Basic.

you won't find a bmp loader for GWBasic. Look for one for qbasic and try to convert i guess.

Posted: Thu Jul 29, 2004 9:46 am
by Enigma...
I know... qbasic is easier and better.
But I just wanna try if it is possible. See it as a challenge.

So can anyone help me?
Can I use Assemble maybe to access 256 color modes?

Posted: Tue Oct 12, 2004 7:31 am
by knico
Try google :laugh:

Posted: Tue Oct 12, 2004 11:57 pm
by barok_unlogged
okay... that doesn't make sense... you want to create a bitmap loader in gwbasic for the challenge... yet your asking for HELP....

:blah: kids nowadays... why don't you just head to qbasicnews?

I suggest antoni's bitmap loader. it's a geocities page... but i don't know which.

Posted: Tue Oct 19, 2004 10:13 am
by Guest
gwbasic can't do screens with 256 colors when i remember correctly.

Posted: Thu Oct 21, 2004 7:21 am
by Guest
:blah:

Posted: Tue Oct 26, 2004 12:02 pm
by Enigma...
But I mean...
Isn't there any way I can do that by using asembly code?

and b.t.w. I'm not saying gwbasic is better that qbasic.
please don't get me wrong here. :upset:

Posted: Tue Oct 26, 2004 4:30 pm
by Interon 2.0
BMPs didn't even exist when GWBasic was made, so unless there's a converter or a hack, it's about 99% impossible.

Posted: Wed Oct 27, 2004 5:01 am
by Frenkel
Sure, you can do everything in assembly.

Posted: Wed Oct 27, 2004 9:40 am
by Interon 2.0
Yeah that's about 99.9% true

But then you would need to make changes to GWBasic itself, and I'm not sure how one would go about that without the original Microsoft source code.

Unless GWBasic has an internal function that allows high-resolution graphics (lots of pixels). Then you may be able to rig a BAS file that GWBasic would interpret it and draw the picture.

Or wait a moment... Isn't GWBasic's limit 64 KB? So the bitmap must be smaller than 64 KB, and even when you add a bitmap, there's not much room left for source code.

And even to accomplish this feat, you may need an enormous amount of free time, patience, and intelligence.

So IMO, you may as well leave off this ambitious project. It's probably more trouble than it's worth.

Posted: Wed Oct 27, 2004 11:18 pm
by barok
Frenkel: yes, you could do anything in assembly, but you wouldn't want to use 1000 lines of assembly to make a game that takes 10 lines of basic, would you?

Enigma: I never thought you said that gwbasic was better than qbasic. However, since most people at qbasicnews have dealt with gwbasic too, they'd be the people to go to. Basically, the people there would be able to give you over 10 times as much support and information as here. (no offense, but some of the people at qbnews are gurus.)

Interon: It doesn't matter if bitmaps weren't made before or during the time of gwbasic. As long as you understand the file format of the bitmap, you'll be fine. Basically, this guy wants a 320x200x256 colors bitmap. (he wants screen 13, that is it's resolution.) Now, 320x200= 64000 pixels. However, due to the way that screen 13 handles bits, bytes and pixels, you only need an array that's 32001 integers large. (you'll see where the one comes form in a minute.) you see, 8 bits = 1 byte. Now 1 byte = 1 pixel. you still with me? Now TWO bytes = 1 integer. So therefore, we can fit a 320x200 picture into this array: picture(32000) However, since basic starts counting from 0 instead of 1, the array should be this. (31999) Now, i said the array should be 32001. That means we have two extra integers somewhere. Those extra integers hold the length and width of the picture. It's odd, really. the first integer holds the size of the picture... IN BITS!!! Before you start panicking, remember that 8 bits = 1 byte = 1 pixel. So therefore, all we have to do is take the width of the picture and times it by 8. the height of the picture has to be in pixels. That's true.

Btw Interon, from what i understand of what your saying, your saying that gwbasic can't handle a picture that large. It can. The source to load and display the picture shouldn't be large at all, and the picture is only 32 kb large. So therefore the person can load the bitmap and still have lots of room for code. And btw, i've coded in gw before, and as i recall, i've loaded more than 64 kb of code and variables before with no ill effects...

just run gwbasic with /ah and you'll be fine.

Posted: Thu Oct 28, 2004 9:52 am
by Da_Goat
Well guys, if you ever accomplish it, please put a link so I can download the BAS file, so I can be shocked and amazed...

Posted: Thu Oct 28, 2004 6:02 pm
by Interon 2.0
Note: the above post is mine and not Da_Goat's. See http://www.dosgames.com/forum/viewtopic-nc-t-4304.html for more information.

Posted: Sat Dec 04, 2004 5:56 am
by relsoft
Enigma... wrote:I know... qbasic is easier and better.
But I just wanna try if it is possible. See it as a challenge.

So can anyone help me?
Can I use Assemble maybe to access 256 color modes?
Yeah, make a com file that switches the screen res using int 10h and call absolute. Or if gwbasic supports call interrupt.

Posted: Mon Dec 06, 2004 7:02 pm
by b_unlogged
hey, listen to this guy! He's a guru! Consider yourselves graced by his presence!

Posted: Fri Dec 10, 2004 1:03 pm
by Jack Bond the guest
I need help too. I'm not sure how to draw pixels. can any1 help me?

Posted: Fri Dec 10, 2004 4:34 pm
by Guest
Look in QBASIC Help, under the DRAW command.

Posted: Fri Dec 10, 2004 9:43 pm
by Jack Bond
I don't use qbasic I use GW basic

Posted: Sat Dec 11, 2004 12:27 pm
by bond
nevermind the graphics
I just wanna show a CCOOLL one I did :cuccoan: