Old Quick Basic 4.5 program I wrote....

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
User avatar
rileyil77
Newbie
Posts: 8
Joined: Sat Jun 09, 2012 5:26 pm
Location: Pontotoc, MS
Contact:

Old Quick Basic 4.5 program I wrote....

Post by rileyil77 »

Friends,

Last night while Burger2227 helped me through a message on here, I got to looking and found an old Mortal Kombat Guide I wrote in Quick Basic 4.5. I ran it through QB64 and everything was cool, except my HELP section and the final screen that loaded up which was an ANSI Graphic file. ANSI Graphics were the main graphically colored menues, old school dial-up (modern day Telnet) BBSes used for the menu screens. ANSI Graphics are also commonly called CGA Graphics and manly eary games such as Leisure Suit Larry 1 and 2, Police Quest 1 and 2, and several others used imbedded ANSI coded CGA Graphics as there backgrounds and their characters in some cases. This is the reason many early renditions of modern day computer characters looked blocky and square.

Now that it was 16 years ago when I last updated the program, and modern day PCs don't load MS-DOS with ANSI.SYS included with it, I can't us my ending screen. So, I opened my FATALITY.ANS with ANSI Viewer for DOS in DOSBox, and screen captured the ANSI with the old Print Screen trick. I then opened Windows Paint and got me a PNG of the ANSI screen.

My problem is this... I'm read several places on the QB64 Wiki about uses pictures, but my silly program errors out everytime with this:

Image

My code for the PNG screen to appear is most likely the problem and I'm not doing something right... Here is that code.

Code: Select all

SUB sega
CLS
SCREEN 12
i& = _LOADIMAGE("FATALITY.PNG")
_PUTIMAGE , i&
END
END SUB
Can anyone tell me what I'm doing wrong?
Riley Personal Computer Doctor
We service from Memphis, TN. to Birmingham, AL.
For free Computer-Tech Support
or ProBoard BBS software support
http://rileypcmd.com
I wish to God I did know now the things I did know then.
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Re: Old Quick Basic 4.5 program I wrote....

Post by burger2227 »

Is the image 24 bit? QB64 would need a 32 bit screen mode.

Code: Select all

SCREEN _NEWIMAGE(800, 600, 32) 'requires 32 bit screen mode to load
i& = _LOADIMAGE("FATALITY.PNG", 32) ' or add 32 if loading image in SCREEN 0 

IF i& < -1 THEN 'verify image handle value or function errors may occur
  w& = _WIDTH(i&)
  h& = _HEIGHT(i&)
  SCREEN _NEWIMAGE(w&, h&, 32) ' 32 bit screen mode
  _PUTIMAGE , i&
END IF
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
User avatar
rileyil77
Newbie
Posts: 8
Joined: Sat Jun 09, 2012 5:26 pm
Location: Pontotoc, MS
Contact:

Re: Old Quick Basic 4.5 program I wrote....

Post by rileyil77 »

burger2227 wrote:Is the image 24 bit? QB64 would need a 32 bit screen mode.

Code: Select all

SCREEN _NEWIMAGE(800, 600, 32) 'requires 32 bit screen mode to load
i& = _LOADIMAGE("FATALITY.PNG", 32) ' or add 32 if loading image in SCREEN 0 

IF i& < -1 THEN 'verify image handle value or function errors may occur
  w& = _WIDTH(i&)
  h& = _HEIGHT(i&)
  SCREEN _NEWIMAGE(w&, h&, 32) ' 32 bit screen mode
  _PUTIMAGE , i&
END IF
Thanks, Burger2227. That worked.
Riley Personal Computer Doctor
We service from Memphis, TN. to Birmingham, AL.
For free Computer-Tech Support
or ProBoard BBS software support
http://rileypcmd.com
I wish to God I did know now the things I did know then.
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Re: Old Quick Basic 4.5 program I wrote....

Post by burger2227 »

You can increase or decrease the screen size or the screen coordinates to make the image bigger or smaller. _PUTIMAGE allows the image to be manipulated to fit on any part of the screen also.
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