Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LOAD BITMAP AND PHOTO VIA QBASIC 1

Status
Not open for further replies.

smoothy

Programmer
May 9, 2003
3
US
I'm trying to create bitmaps in Paint, and then load them in qbasic. Is this the correct approach - and is it possible to build a simple subroutine ?
 
Hello smoothy,
The answer on "Is this the correct approach" depends on what you are going to do.

But if you just want to load a picture you 've just draw (in Paint or something else), you have 2 choises (I think).
1. Hard way.
Get a description of a BMP file format (from Internet or some book), understand it and write a sub that will read BMP file in BINARY mode and put pixels in right places, so to speak.
2. Easy way.
Search for "Bitmap loader" or similar (GIF loader)
- you'll sure find ready-to use sub.

Some place to search is
See also threads in this forum that were returned by search for "BMP":

thread314-415404 can also search for GIF...
 
Thanks for the reply tsh73. I think I'll look for the format. I tried to borrow a pre-written subroutine that failed to work, and left me guessing on the format, although the code seemed solid.

As for my approach - I am trying to write children's learning games, so I want to be able to make a lot of pretty pictures and tweak them a little.

smoothy
 
I've just wrote "file formats" on Google and get several seem to be relevant links. Ypu'll probably have very little problem here.

But it is possible that your code will be slow.

Of course you remember that you'll have no more then 320x200 pixels 256 colors in pure QBasic (SCREEN 13).


 
I've written a number of BMP loaders in you can have -- for SCREEN 12, 13 and Vesa modes. They're on this page:

Here's a nice program on Toshi's project page that loads many kinds of BMP's:

Allbasiccode.com Has tons of BMP loaders, many of which you can still find on the old ABC site here:

- Dav

------------------
Visit THE CODEPOST
-----------------------------------------
 
CodePost,
I visited first link, tried your subs.
They are EXELLENT!

Very helpful post.

smoothy,
I think you should try it. You can save lots of time here.
 
Thank you to tsh73 and codepost - I haven't went anywhere yet, but thanks for your guidance. And I did not know about the qbasic pixel limitation. I was going to use screen 9 (640 x 350).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top