Qbasicnews.com

Full Version: Help in viewing picture files in QBASIC
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am very very sorry if this has been posted or asked before as I've only done a quick search through the forums for it.

I am currently working with a friend on an RPG in QBASIC and I was wondering if there any programs that can open a JPEG, BMP, PNG, or any other type of picture file and display it on the screen in QBASIC. I've found a few programs that do this but their systems to open files are extremely complex (menu based and input based) for my level of programing as all I need is to specify a filename in the program to open the file (the file will be preloaded in a location). There is a very short deadline for this project and such a picture viewer would save a lot of time in the area of graphics and would help with the overall look.

I will check if using such a program is allowed, hopefully it will be, but I was hoping to get some help in advace. In the meantime I will try to decode the JPEG viewer I found. I'm not sure if I can share it here as it is not my program originally, but if so I am able to, I will. Hopefully I can pull it together somehow.

Also I wasn't sure if this should go in Programming help or Projects, but since it is a project I chose this section...

Upon further inspection of the program, any picture viewer in QBASIC would be nothing short of a miracle. Sorry if my question seemed a little outlandish to anyone. I'll try to do more research next time...
np, but you need to give more specs, there's several questions that are still open:

- are you using a library like ugl, dqb, futurelib, rellib?
- if not what screenmode do you use with the SCREEN command?
- what bitdepth do the pictures have?
- should the gfx be animated?

the best and easiest way to achieve what you want is to download one of the libraries mentione (ugl can be found at http://www.bad-logic.com and simply use the functionality provided in there.

if you're only supposed to use pure qbasic stuff, then go to http://www.qb45.com and search the download archive for gif/bmp etc. loaders. iirc there's plenty of them.
- are you using a library like ugl, dqb, futurelib, rellib?

I don't know how to use libraries yet, but I'll research it in the near future

- if not what screenmode do you use with the SCREEN command?

SCREEN mode really doesn't matter

- what bitdepth do the pictures have?

The bitdepth will be irrelevant; I will make the picture fit a bitdepth.

- should the gfx be animated?

Probably not.


Basically, I just need a program to display a picture of any kind on the screen. I will save the picture to the format that the program will require. Thank you for the website, I will look into it right now.
If it's for an RPG, you should use an external tool to convert all pictures to a single format, so you only have to implement that format in QB.

As the programmer of a JPEG viewer for QB (perhaps you are looking at my code?) I can tell you JPEG is ths most difficult standard format. I would not start with that one if I were learning. The jpeg standard has more than 200 pages.... IMHO you should start understanding BMP and PCX, then GIF, and then JPG.
Anyway, If you want to ask questions qbout that JPEG code here I will try to help you.