convert graphic screen to e.g. JPG file

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
merallas
Newbie
Posts: 8
Joined: Thu Sep 21, 2006 10:20 am
Location: netherlands
Contact:

convert graphic screen to e.g. JPG file

Post by merallas » Thu Sep 21, 2006 2:54 pm

I have written a couple of programs in qbasic that can solve and generate new sudokus. At the moment the output is a 9x9 digit .txt file (without grid), where zero's represent empty places. However, it would be nice if a complete sudoku could be generated which can be inserted in a word file. To generate a grid with figures in the graphic mode is no problem; but how to convert the graphic screen to a JPG or something like that without repeating handwork.

User avatar
Patz QuickBASIC Creations
Veteran
Posts: 399
Joined: Wed Mar 02, 2005 9:01 pm
Location: Nashville, Tennessee
Contact:

Post by Patz QuickBASIC Creations » Thu Sep 21, 2006 3:52 pm

I made a Sudoku program for the TI-83 Plus calculators. I could make one in QuickBASIC, but it's not going to have graphics, just ASCII art.

Dr_D
Veteran
Posts: 58
Joined: Fri Jun 17, 2005 4:47 pm
Contact:

Post by Dr_D » Fri Sep 22, 2006 6:48 am

It would be alot easier to save a bitmap. There are tons of those floating around for QB. Unless, you need to save it for the web?
The Dr. is INsane!!!

merallas
Newbie
Posts: 8
Joined: Thu Sep 21, 2006 10:20 am
Location: netherlands
Contact:

Post by merallas » Fri Sep 22, 2006 10:01 am

Dr_D wrote:It would be alot easier to save a bitmap. There are tons of those floating around for QB. Unless, you need to save it for the web?
Thanks for your reply.
I think that bitmap is good enough for this application. Can you supply a site with examples. I found several information about reading files, but no generation.

Regards,
Henderikus

Dr_D
Veteran
Posts: 58
Joined: Fri Jun 17, 2005 4:47 pm
Contact:

Post by Dr_D » Fri Sep 22, 2006 5:40 pm

Well, I don't know of any, right off the top of my head. Compared to other things, it's really not hard at all. You could start by trying to reverse one of the loaders. ;)
The Dr. is INsane!!!

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

Post by Nodtveidt » Sun Sep 24, 2006 10:35 pm

I had a program at one point in time that could convert an SBS file (Super BSave) to a GIF image. Unfortunately, I lost the sourcecode long ago and I can't find the program at the moment but I'll see if I can dig it up. All you have to do is add a small portion of code to your program to capture an SBS file, then run that file through the converter to get a noninterlaced GIF87a image. I'll see if I can find them both, they're probably in my old QB-based WOS game.

merallas
Newbie
Posts: 8
Joined: Thu Sep 21, 2006 10:20 am
Location: netherlands
Contact:

Post by merallas » Mon Sep 25, 2006 2:30 am

Nekrophidius wrote:I had a program at one point in time that could convert an SBS file (Super BSave) to a GIF image. Unfortunately, I lost the sourcecode long ago and I can't find the program at the moment but I'll see if I can dig it up. All you have to do is add a small portion of code to your program to capture an SBS file, then run that file through the converter to get a noninterlaced GIF87a image. I'll see if I can find them both, they're probably in my old QB-based WOS game.
Sounds promissing, I will wait

Regards,
Henderikus

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

Post by Nodtveidt » Sun Oct 01, 2006 7:46 am

Sorry about the late response, it's been a busy week. Anyways, here ya go:

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

It includes the sbs2gif converter with its documentation, plus some sourcecode to save an SBS file. Note that it only works in SCREEN 13 so if you're using a different screenmode, this won't help you much.

Oh...also, the documentation is slightly wrong. Drag-and-drop doesn't seem to work for this tool, you have to use it from the commandline and cannot include the extension. So if you have a file such as:

SMPL0001.SBS

you would type:

sbs2gif smpl0001

without the extension. Seems I was a poor coder back then. :oops:

merallas
Newbie
Posts: 8
Joined: Thu Sep 21, 2006 10:20 am
Location: netherlands
Contact:

Post by merallas » Mon Oct 02, 2006 4:52 am

Nekrophidius wrote:Sorry about the late response, it's been a busy week. Anyways, here ya go:

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

It includes the sbs2gif converter with its documentation, plus some sourcecode to save an SBS file. Note that it only works in SCREEN 13 so if you're using a different screenmode, this won't help you much.

Oh...also, the documentation is slightly wrong. Drag-and-drop doesn't seem to work for this tool, you have to use it from the commandline and cannot include the extension. So if you have a file such as:

SMPL0001.SBS

you would type:

sbs2gif smpl0001

without the extension. Seems I was a poor coder back then. :oops:

Thank you very much for supplying this code. Now I will do my best to make it operational at my computer.

Thanks,
Merallas

Post Reply