BMP's in gwbasic
BMP's in gwbasic
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
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
-
- Experienced Member
- Posts: 54
- Joined: Fri Sep 24, 2004 3:58 pm
Sure, you can do everything in assembly.
Groeten van Frenkel
Visit us at the Official S&F Prod. Homepage
Visit us at the Official S&F Prod. Homepage
-
- Experienced Member
- Posts: 54
- Joined: Fri Sep 24, 2004 3:58 pm
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.
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.
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.
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.
Qbasic can do much more than you think!
-
- Experienced Member
- Posts: 54
- Joined: Fri Sep 24, 2004 3:58 pm
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.
Yeah, make a com file that switches the screen res using int 10h and call absolute. Or if gwbasic supports call interrupt.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?