Page 1 of 3

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

Posted: Sat Oct 27, 2007 8:52 am
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?

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

Posted: Sat Oct 27, 2007 9:32 am
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

Posted: Sat Oct 27, 2007 10:19 am
by Mentat
Okay. So can it be done in QB?
Thanks for the link. :)

Posted: Sat Oct 27, 2007 12:10 pm
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

Posted: Sat Oct 27, 2007 12:59 pm
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.

Posted: Sat Oct 27, 2007 3:36 pm
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?

PAINT is a piece of garbage!

Posted: Sat Oct 27, 2007 4:46 pm
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

Posted: Sat Oct 27, 2007 6:41 pm
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.

Posted: Sat Oct 27, 2007 9:57 pm
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.

Posted: Sun Oct 28, 2007 12:24 pm
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.

Posted: Sun Oct 28, 2007 1:23 pm
by Mentat
Before this turns ugly :roll: :
What about the monthly poll?

Posted: Sun Oct 28, 2007 1:36 pm
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:

Posted: Sun Oct 28, 2007 6:37 pm
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?

Gotcha - WILCO (n/t)

Posted: Sun Oct 28, 2007 8:41 pm
by Mac
n/t

Posted: Sun Oct 28, 2007 8:57 pm
by Mentat
"n/t
Ah Mac, don't worry. My main question was answered.

Posted: Mon Oct 29, 2007 10:35 am
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;
}

Posted: Mon Oct 29, 2007 4:11 pm
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.

Posted: Mon Oct 29, 2007 4:21 pm
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.

Posted: Thu Nov 01, 2007 9:08 pm
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.

Posted: Fri Nov 02, 2007 12:19 am
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