Can I make an image in Paint, then have a FB program load it

The forum for all of your Freebasic needs!

Moderators: Pete, Mods

User avatar
Mentat
Veteran
Posts: 409
Joined: Tue Aug 07, 2007 3:39 pm
Location: NC, US

Can I make an image in Paint, then have a FB program load it

Post by Mentat »

Or just any image (in bitmap)?

And while I'm at it (I don't feel like making an extra post for this), what about the monthly polls?
For any grievances posted above, I blame whoever is in charge . . .
Mac
Veteran
Posts: 151
Joined: Mon Aug 06, 2007 2:00 pm

Re: Can I make an image in Paint, then have a FB program loa

Post by Mac »

[quote="Mentat"](a FB question)[/quote]

Why don't you ask FB questions here:
http://www.freebasic.net/forum/

Experts galore there.

This is a QBasic forum, not FB. (Or, if it's mission has changed, maybe future QBasic questions should go to www.qbasic.com.

Mac
User avatar
Mentat
Veteran
Posts: 409
Joined: Tue Aug 07, 2007 3:39 pm
Location: NC, US

Post by Mentat »

Okay. So can it be done in QB?
Thanks for the link. :)
For any grievances posted above, I blame whoever is in charge . . .
Mac
Veteran
Posts: 151
Joined: Mon Aug 06, 2007 2:00 pm

Post by Mac »

Mentat wrote:can it be done in QB?
I don't know. I posted your question, modified to "Is there an easy way to take a BMP file such as would be created by Microsoft's Paint and display it via QBasic?" on The QBasic Forum in a thread discussing this problem.

I'm assuming, until corrected, that the answer is that there is no way for a programmer to use a bitmap image except to figure out the format of BMP files and write a zillion lines of code to convert it to QBasic image format.

TheBob, our graphics expert, has created utilities that he uses in lieu of Paint to make images pixel-by-pixel and save them in a way they can be used. It all blows my mind. I always just use scroll-mode ASCII and never use any graphics at all in any program I have ever written.

Mac
User avatar
Mentat
Veteran
Posts: 409
Joined: Tue Aug 07, 2007 3:39 pm
Location: NC, US

Post by Mentat »

Actually, I meant a built-in function, like in BlitzBasic. I know FB has CreateImage(), but I don't think it does what I want (it creates the image during run-time, but doesn't load). I'm thinking QB might have an equivalent to ImageLoad(), but I'm not sure if there is one or what the actual function is.

If it's possible, it would be much easier to draw a sprite in paint, and then load it. I noticed that when I loade some of the QB games here, the folders already had some images ready.
For any grievances posted above, I blame whoever is in charge . . .
User avatar
Brandon
Coder
Posts: 47
Joined: Sat Nov 19, 2005 9:24 pm
Location: NY
Contact:

Post by Brandon »

FB can load BMP images with
BLOAD FILENAME$

And QB can if you get a subrountine. I have one somewere.
Is this what you wanted?
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

PAINT is a piece of garbage!

Post by burger2227 »

You will need a decent picture editing program like Paint Shop or Photoshop. You might be able to use a decent scanner photo editor. Look around for one.

The reason you need a decent editor is that QB can only use bitmaps of 4 or 8 Bits Per Pixel for images to be displayed in color. SCREEN 13 is best for pictures! 4 bit is good for SCREEN 12 and cartoons or diagrams.

Also you may need to resize the bitmap to fit the screen. SCREEN 13 also needs the height reduced to 83% of it's original size to look correct.

Qbasic can convert the image using a bitmap loading routine for the SCREEN 12 or 13 modes. You can also GET the image into an array and BSAVE it, but this is not a simple project.

Finally, if you are using sprites, they must use the same color settings or one will affect the other's. But in 13 you can use 256 colors.

I have a BSAVER at QBasicStation.com in member files.

Ted
Lachie Dazdarian
Veteran
Posts: 202
Joined: Mon Aug 30, 2004 6:18 am
Location: Croatia
Contact:

Post by Lachie Dazdarian »

How about downloading http://downloads.sourceforge.net/fbc/FB ... p?download ?

Of course FB can load BMP files. And other file formats too, but you need libraries for that. Look it up.
Lachie Dazdarian - The Maker Of Stuff
Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Post by Nodtveidt »

Mac, unlike on your forum, people ask questions for both QB and FB here, and they do it without fear of being ostracized for either compiler.
roy
Veteran
Posts: 55
Joined: Sun Jul 29, 2007 2:39 pm
Location: London

Post by roy »

Unlike your forum Mac does not ban anyone and only deletes posts that go over the top. FB and QBasic are discussed at network54 but as yet you do not seem to have posted.
PS
Mac did request that any discussion of FB should be in other forums , due to the flak that you were recieving, that was taking up our normally sedate replies.lol
PPS
If you think that we are being restrictive then ask Vic why he has closed the Off Topic Forum. I will tell you why, it is because Vic can not stand criticism. This is also why people like you are having to come to a QBASIC site.
Last edited by roy on Sun Oct 28, 2007 2:06 pm, edited 2 times in total.
User avatar
Mentat
Veteran
Posts: 409
Joined: Tue Aug 07, 2007 3:39 pm
Location: NC, US

Post by Mentat »

Before this turns ugly :roll: :
What about the monthly poll?
For any grievances posted above, I blame whoever is in charge . . .
roy
Veteran
Posts: 55
Joined: Sun Jul 29, 2007 2:39 pm
Location: London

Post by roy »

LOL I vote for Kruschev.
PS
Ugly? That was mild for me. lol :D :) :( :o :shock: :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow:
User avatar
Pete
Site Admin
Posts: 887
Joined: Sun Dec 07, 2003 9:10 pm
Location: Candor, NY
Contact:

Post by Pete »

Nodtveidt wrote:Mac, unlike on your forum, people ask questions for both QB and FB here, and they do it without fear of being ostracized for either compiler.
Precisely. You can ask questions about, or discuss ANY programming language here -- QBasic, FreeBasic, FORTRAN or LOLcode. Any and all are welcome.

I would appreciate it if you guys would stop arguing with each other about which programming languages are allowed, and maybe try to answer each other's questions for once.

And FYI, this site specializes in both QB *and* FB. Have you looked at an issue of QB Express lately?
Mac
Veteran
Posts: 151
Joined: Mon Aug 06, 2007 2:00 pm

Gotcha - WILCO (n/t)

Post by Mac »

n/t
User avatar
Mentat
Veteran
Posts: 409
Joined: Tue Aug 07, 2007 3:39 pm
Location: NC, US

Post by Mentat »

"n/t
Ah Mac, don't worry. My main question was answered.
For any grievances posted above, I blame whoever is in charge . . .
roy
Veteran
Posts: 55
Joined: Sun Jul 29, 2007 2:39 pm
Location: London

Post by roy »

Pete, I hate to be pedantic but why do you call yourself Pete`s QBASIC Site if you are a general purpose in thing type site, also please change the name QB Express if it is not QB.
PS
How do you answer questions like this from a newbie if you are going to include all languages.
What is the correct way to print "Hello world"
PRINT "Hello World" or
#include <iostream>
int main()
{
std::cout << "Hello World:\n";
return 0;
}
User avatar
Mentat
Veteran
Posts: 409
Joined: Tue Aug 07, 2007 3:39 pm
Location: NC, US

Post by Mentat »

Because "Pete's QB site" stands for:
Pete's Quick free BASIC Site
:D

Cheer up. :) After all, QB and FB are, as of now at least, hobby languages.
For any grievances posted above, I blame whoever is in charge . . .
User avatar
Pete
Site Admin
Posts: 887
Joined: Sun Dec 07, 2003 9:10 pm
Location: Candor, NY
Contact:

Post by Pete »

This site has been called "Pete's QBasic Site" since it launched in 1998. Freebasic didn't even exist until 2004, at which point, I started including Freebasic content on this site. I see no reason to change the long-standing name of this site that everyone has grown used to over the past nine years. Besides, 90% of the people who still use QB these days also use FB.

"QB Express" was launched in August 2004, several months before Freebasic was first released. The magazine was, and always has been, about covering the news from the QuickBasic community. When Freebasic was released, almost all the former QuickBasic coders switched to it. Same people, essentially the same language, but a newer / more exciting / more powerful platform. QB Express shifted with the community that bore it.

At one point, I considered changing the title to "FB Express," then decided not to. Who really cares what the magazine's called? More than half the content it features is about Freebasic, and the readers know that. I see no reason to change the title.

As for the forum, rod, don't be ridiculous. Obviously this site tailors to QBasic and FreeBasic. You'd have to be a fork moron to answer someone's question about printing "Hello world" in anything other than BASIC.

But if someone asks a COBOL question, for instance, I would prefer if you wouldn't flame them. Here's a general rule: Don't be a douchebag.
Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Post by Nodtveidt »

I find it highly incomprehensible that people from qbasic.com (y'know, all those experts and such) would not only not know one of the simplest and easiest-to-implement image formats available, but also not know that such a piece of code already exists on qbasic.com:

http://www.qbasic.com/classic/files/bmp.bas

It took less than 2 minutes to find, from beginning to end.
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 »

Not everybody uses graphics in QB and needs Bitmaps either.

I got a bitmap loader from here and the code did not even run!
It took me a while to get it working, but it is still posted here wrong.
It uses Interrupts to load SCREEN 13 bitmaps, but it still cannot load a full screen.

If anybody wants the adaptation that works, let me know. Bob Seguin is probably the best graphics programmer around and he goes to Network 54. He has some great graphics stuff!

If you prefer stealing somebody else's code off of the web, then you are not a programmer!

Ted
Post Reply