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

Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Post by Nodtveidt »

burger2227 wrote:Not everybody uses graphics in QB and needs Bitmaps either.
This thread was about bitmapped images.
burger2227 wrote:I got a bitmap loader from here and the code did not even run!
You probably don't know how to use it, or how to implement it into your own program. Cut-and-paste coding is not the answer. Even that simple example on qbasic.com could never be used straight-up, one should use it to study how BMP images are read and then write their own method, preferably one that would work a bit faster and optimized for their screen mode of choice.
burger2227 wrote:If you prefer stealing somebody else's code off of the web, then you are not a programmer!
If you steal someone else's code, you have a future career with Microsoft. :lol:
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 »

Well, that program looked like it should have worked, and after a lot of tries, I posted it at Network 54 Qbasic Forum and a guy got it working using PEEK instead of string manipulation of the color palette string.

And it still cannot do large bitmaps in SCREEN 13! And now my old bitmap loaders will not load the color palette for screen 13 anymore using the ASCII information! I will have to convert them using PEEK.

The code is here if you want to try it! Look for Interrupt demo with a "bonus" fast bitmap loader. Should I sue Pete? LOL It has been here several years now.

Yes, you probably did work for M$, Bill.

Ted
Mac
Veteran
Posts: 151
Joined: Mon Aug 06, 2007 2:00 pm

Re: QBasic

Post by Mac »

[quote="Nodtveidt"][/quote]

I don't see any QBasic programs written by you in our Proud Of Subforum.

Mac
Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Re: QBasic

Post by Nodtveidt »

Mac wrote: I don't see any QBasic programs written by you in our Proud Of Subforum.

Mac
You probably won't find any programs written by me at all on your site. I'll take a look and see though.

*looks*

Hrm...nothing on the classic site, or at least not under the name I used back then (only scanned for my old nickname). I also don't see any "Proud Of" subforums on either of the forums that are linked from the index page. If you have anything at all, it'll likely be listed under the names Kaddash, Lost Sock, or Nekrophidius. I don't think I released anything in the QB world as Nodtveidt, and certainly not under the moniker I'm using elsewhere now.

I'm not quite sure what your intention is by stating something like that, but knowing you, I'm guessing it's neither tactful nor honorable. However, if you would like a list of my programs written in and/or for QB, just say so and I'll provide said list, and see if I can find any remaining download links for them.
BDZ
Coder
Posts: 49
Joined: Sun Nov 20, 2005 5:41 pm
Location: Wisconsin
Contact:

Re: QBasic

Post by BDZ »

Mac wrote:
I don't see any QBasic programs written by you in our Proud Of Subforum.

Mac
You know, you guys are being pretty rude to the kindly QuickBasic master that is trying to help you and others. If it were me (which it is) I wouldn't take the time to answer your questions.
merallas
Newbie
Posts: 8
Joined: Thu Sep 21, 2006 10:20 am
Location: netherlands
Contact:

Post by merallas »

Nodtveidt wrote: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.
I have tested the program. Input was a .bmp generated by paint. Unfortunately all possibilities; monochroom, 16 bit etc generate incomplete inclined pictures. For my sodoku program I am still looking for a qb program which translates a graphic screen to .bmp. Is there a working version to day?
User avatar
Mentat
Veteran
Posts: 409
Joined: Tue Aug 07, 2007 3:39 pm
Location: NC, US

Post by Mentat »

nt

...

jk :D

Ah, some of you need to lighten up. :lol:

By the way, does anybody know anything about the next monthly poll?
For any grievances posted above, I blame whoever is in charge . . .
Lachie Dazdarian
Veteran
Posts: 202
Joined: Mon Aug 30, 2004 6:18 am
Location: Croatia
Contact:

Post by Lachie Dazdarian »

FB saves your screen quite neatly into bitmaps using BSAVE and putting the ."bmp" extension to file to save. But yeah, you want QB?.because it?s fun.
Lachie Dazdarian - The Maker Of Stuff
Mac
Veteran
Posts: 151
Joined: Mon Aug 06, 2007 2:00 pm

Re: QBasic

Post by Mac »

[quote="Nodtveidt"]I also don't see any "Proud Of" subforums on either of the forums that are linked from the index page.... I'm not quite sure what your intention is by stating something like that, but knowing you, I'm guessing it's neither tactful nor honorable.[/quote]

If you go to www.qbasic.com, you will see a link to "The QBasic Forum".
http://www.network54.com/Forum/13959

If you go there, you will see a link to a QB_FAQ, Homework Help, and Subforums, Links and Downloads, Chat Room.
Click on the latter of the three, namely
http://www.network54.com/Index/10167

Look down the list of Subforums and see "Programs you are proud of", namely,
http://www.network54.com/Forum/178387/

There you will see "RULES", namely that you should create a new thread under your name and, after doing that, create replies to your own thread consisting of programs you have written in QBasic (in Source form only).

If you want to see some of mine, they can be found by doing a search on "ProgramList Mac" (include quotes).

So I did a search on "ProgramList Nodtveidt" and got no match, hence my post.

I wanted to see your coding techniques.

As re: "knowing you, I'm guessing it's neither tactful nor honorable", you obviously do not know me. Well, not "tactful" may be appropriate. But my only honor is a love for programs written that will run in the QBasic 1.0 IDE.

For some unusually interesting programs along that line, see "ProgramList TheBob".

Actually, there are a zillion programs under many names in the "Proud Of" subforum.

You could also participate in the main forum, assuming you are a QBasic person.

Looking forward to your entries.

Mac
BDZ
Coder
Posts: 49
Joined: Sun Nov 20, 2005 5:41 pm
Location: Wisconsin
Contact:

Re: QBasic

Post by BDZ »

Mac wrote:
Nodtveidt wrote:I also don't see any "Proud Of" subforums on either of the forums that are linked from the index page.... I'm not quite sure what your intention is by stating something like that, but knowing you, I'm guessing it's neither tactful nor honorable.
Looking forward to your entries.

Mac
So now Nodtveidt has to post some of his QuickBASIC source code at your forum just to prove that this thread is actually about working with bitmaps in FreeBASIC?

Now that I look back more closely at the beginning of this topic, I see why this is going on. Mac just wants people to come to his forum instead of this one. Well, at another forum that I post at, they don't even allow people to advertise other forums. I think its in rather poor taste to come here, intercept an innocent conversation about FreeBASIC and bitmaps with an encouragement to go to a different forum, and then when everybody except you and the burger character says "no thanks", to respond with random dissing.

Man, the n00b problem at this forum is really getting out of control.
Mac
Veteran
Posts: 151
Joined: Mon Aug 06, 2007 2:00 pm

Bye to this thread

Post by Mac »

History of this thread:

1) FB Question

2) I, thinking this was a QBasic Forum, gave the OP the URL of the FB forum, thinking to do the OP a favor. Why clutter a QBasic forum with FB posts?

I then, not trying to recruit, posted a reference to www.qbasic.com, in case Pete's QBasic Forum was now Pete's FB Forum.

3a) The OP thanked me for the link. If that was all, then I would have expected the thread to end at that point and the OP would continue at the FB forum.

3b) But the OP also asked if it could be done in QB.

4) Yada-yada-yada, where I learned that this site is for all languages, not just QBasic. Fine. If I could do my first post again with my current knowledge, I would have simply posted "You might also want to try this forum (fb forum)" and left it at that. I would have no reason to reference www.qbasic.com because I would know that this site handles ALL languages, including QBasic and I hate SPAM as much as the next guy.

5) But eventually Nodtveidt posted that he could solve the problem in 2 minutes (I quote) that the QBasic Forum people struggled with for a week. Impressed with such an intellect in the community, I presumed there would be some genius programs posted that I could learn from.

6) Nodtveidt enquired as to where that forum was, so I gave details, so he/she could post some great QBasic source code.

7) Despite repeated attempts by the OP (Mentat) that we "lighten up", the thread is turning to a general attack on me. Fine. I have a tough skin. Flame away. (Free flaming, by the way as I will be making no more posts in this thread). My interests are in QBasic (on whatever forum it is discussed) not purile internet flame wars. My site has links to as many other QBasic sites as I can find and I consider them all great, even the ones that are poluted by other languages once I know to expect it. It is like I go to a auto-parts store and find that most of the products for sale are sailboat-parts.

By the way, does anybody know anything about the next monthly poll?
(Last attempt to help the OP) :)

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

Post by Lachie Dazdarian »

You got some serious issues Mac.
Lachie Dazdarian - The Maker Of Stuff
User avatar
Pete
Site Admin
Posts: 887
Joined: Sun Dec 07, 2003 9:10 pm
Location: Candor, NY
Contact:

Post by Pete »

This whole "segregation of languages" thing is so stupid to me...especially between different dialects of BASIC that are 90% compatible with each other.

Mentat's right. Lighten up, guys.
Mac wrote:It is like I go to a auto-parts store and find that most of the products for sale are sailboat-parts.
I'd say it's more like going to an autoparts store that is mostly selling parts for a 2007 car rather than a 1988 car, because hardly anybody drives the 1988 version anymore.

The reason why I started putting FB content on this site was because I am tailoring to my "market" which now predominantly uses FB. That isn't to say that my market does not also include the QB users. I value both equally, and have content that will make both happy.

And for all you COBOL, FORTRAN, and LOLcode users... sorry, I don't stock your sailboat parts in my store, but you're still welcome to shop here.
Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Post by Nodtveidt »

I haven't coded in QB in about three years now, ever since FB was released. Wonder how many people in this thread even touch it anymore...

Btw Mac, here's a partial list of the things I've made in or for QB:

Games
The Wrath Of Sona (RPG)
Monolith (RPG)
RGB (RPG)
Killers (Vs Fighting)
Two Lords (First Person Shooter)
Fundee (One Key Challenge)

Utilities/Libraries
Twisted Sock (640x480x16bpp graphics library in pure QB)
Smelly Sock (320x240x16bpp graphics library in pure QB)
Useless Sock (textmode graphics library in pure QB)
SockMouse (mouse library)
Harmony Slave (MIDI library)
DS4QB (multimedia library)

Other Programs
SockWeb (a real working web browser using Twisted Sock, even displayed JPG images)

Other General QB Stuff
QuickBASIC On Acid (web magazine)

I don't think any of these have ever been posted at qbasic.com. I know there's more I could list here but it's late and not everything's coming to memory right now. I also have zero interest in coding in QB anymore, but for nostalgia's sake, maybe I'll cook up yet another BMP routine for qbasic.com...as if I haven't already written enough of them.

Pete, I need a 1957 Glockenspindel motor brace. Got one of those kickin' around somewhere? :lol:
Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Post by Nodtveidt »

Here's a quickie BMP loader I whipped up for SCREEN 13. I converted it from the FB version of PTCLXL, so a lot of it had to be hacked up to run in QB since QB doesn't have the rich data type support of FB. I then had to modify it even further to run in QBASIC (which I had to actually download a copy of since I didn't have it already) since '$INCLUDE isn't supported (wow that makes code messy after awhile).

http://www.nodtveidt.net/bmpload.zip

It supports 8BPP RGB, 8BPP RLE, and 4BPP RGB in SCREEN 13. I didn't test it with other screen modes, but it should work with SCREEN 12 if you're using 4BPP images and modify the size of the colourz() array.
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 »

Interesting! So how is a RLE bitmap different than any other kind?

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Post by Nodtveidt »

RLE is short for Run Length Encoding, a rather simplistic form of compression that works by storing pixels as run-lengths, telling the loader to plot so many pixels of this index, then so many pixels of this index, etc. until the image is finished loading. Normally, BMP files are stored in RGB format, which simply stores them pixel by pixel (and usually buffers them for speed at the expense of size). But if you have a BMP image that is 8BPP or lower, you can store it as RLE to sometimes save some space. PCX uses RLE compression as well but it uses a different method. The BMP RLE method is more advanced, although I've yet to run into an application that takes full advantage of its abilities. My RLE decoder uses a quick hack for one of the advanced RLE features rather than implementing it according to the standard, but the end result is the same visually (and frankly, I think my method is faster, but then again, Microsoft never really was known for their speed, were they? :D ).

Knowing when to use RLE and when not to is important too. Images that are dithered, or have a lot of unique colors side by side, are better off stored using the RGB arrangement. But images that have a lot of solid areas (like game sprites that have big transparency regions and low color counts) can benefit greatly from RLE. It's kind of like knowing when to use JPEG and when to use PNG...JPEG is great for photographs but terrible for line drawings, and PNG is the other way around. So you've got to know your media before choosing a compression method.
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Segregation

Post by burger2227 »

Thanks for the info on RLE bitmaps!

I really don't see a problem with any programming language, but some are only interested in QB and some only want FB. Whatever!

Yes, Mac would probably like you to come visit his site as it is one of the better sites for QB only. What is wrong with that? He comes to Pete's site too! I don't see any conflict if the main reason you post is to help others.
Perhaps he would even consider a FB area too! But if it turns into a big problem, then forget it.

I think, however a separation of languages would make it clearer to everybody what questions are for what language at this site. I have noticed a slight propensity for FB people to suggest that QB is no longer a viable way to program. Neither of them are better than C, so why argue about it?

Let's just have fun and try to help people...........right!

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Post by Nodtveidt »

When people find something that is better, more powerful, etc., it is human nature to suggest it to others. The fact is that QB is rapidly becoming less and less viable these days with the advancement of Microsoft OSes. You can argue the point until you're blue in the face but it makes no difference...if you want widespread distribution of a modern application, QB is simply not nearly as viable as FB or modern C. It's a sign of the times, and something a lot of older coders who are quite set in their ways are having a hard time coping with. It seems that as you get older, your tendency to move from your comfort zone declines greatly.

I think some people take it to the extremes in something of a religious sense though, but you get that with everything...if not compilers then sewing machines, cars, toothbrushes, etc. But everyone's got the right to their opinion. I may not like the opinions of others, but I'll damn sure defend their rights to have them.

I'll be honest with y'all on one thing...I don't use FB much anymore, and I certainly don't use any current versions. I'm still working on my one and only FB game, Two Lords, with FB 0.15 and I'm not about to upgrade the compiler, only to have to make hundreds of source changes. If it ain't broke, don't fix it, I always say...
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Yep

Post by burger2227 »

That is a problem with FB. It keeps changing and can require a lot of coding changes. That is one thing you will NEVER have to worry about in QB. Most QB users prefer it that way! It is a challenge to make things work with newer stuff.

Presently a fellow named Galleon is working on a QB version that will work with 64 machines. So far it looks pretty good and he is adding other functions that are still compatable with the old code. He uses new names for the new stuff. If FB would do that, then perhaps they could get more converts. I don't want to change code every upgrade like .NET has.

The one thing I don't like so far is that the graphics cannot be made full screen. That bothers me in VB too! Other than that, at least QB will not go up in smoke.

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
Post Reply