I've always been able to take screenshots of my QB games in screen 13 by hitting the Print Screen key and then opening pbrush and hitting Ctrl+V. For instance, my character from DSQ is my avatar and I captured him on an old Compaq running Win95 years ago.
This machine, running WinXP doesn't let me. I've tried several screen shot programs as well and none seem to work. What am I doing wrong??
Screenshots in QB or DOS
- coma8coma1
- Veteran
- Posts: 100
- Joined: Sat Dec 08, 2007 5:29 pm
- Location: Maryland, USA
- burger2227
- Veteran
- Posts: 2466
- Joined: Mon Aug 21, 2006 12:40 am
- Location: Pittsburgh, PA
Try this SUB procedure for Screen 13 that creates a bitmap screenshot:
Code adapted from a routine by Bob Seguin.
In your MAIN module SUB call:
You can use a certain keypress to trigger a snapshot of the screen.
The filename can just be the first name as SUB will add ".BMP" if needed. You could also add a snapshot number to the name for more bitmaps. Screen 13 does it pretty fast.
x1 and x2 can be from 0 to 319, y1 and y2 from 0 to 199 respectively.
I also have a SUB for SCREEN 12 that may take up to 8 seconds to create a fullscreen snapshot.
Code: Select all
SUB EightBIT (x1%, y1%, x2%, y2%, Filename$) 'SCREEN 13 bitmap maker
'takes 1 second fullscreen
DIM FileCOLORS%(1 TO 768)
DIM Colors8%(255)
IF INSTR(Filename$, ".BMP") = 0 THEN
Filename$ = RTRIM$(LEFT$(Filename$, 8)) + ".BMP"
END IF
FileTYPE$ = "BM"
Reserved1% = 0
Reserved2% = 0
OffsetBITS& = 1078
InfoHEADER& = 40
PictureWIDTH& = (x2% - x1%) + 1
PictureDEPTH& = (y2% - y1%) + 1
NumPLANES% = 1
BPP% = 8
Compression& = 0
WidthPELS& = 3780
DepthPELS& = 3780
NumCOLORS& = 256
IF PictureWIDTH& MOD 4 <> 0 THEN
ZeroPAD$ = SPACE$(4 - PictureWIDTH& MOD 4)
END IF
ImageSIZE& = (PictureWIDTH& + LEN(ZeroPAD$)) * PictureDEPTH&
FileSize& = ImageSIZE& + OffsetBITS&
OUT &H3C7, 0
FOR n = 1 TO 768 STEP 3
FileCOLORS%(n) = INP(&H3C9)
FileCOLORS%(n + 1) = INP(&H3C9)
FileCOLORS%(n + 2) = INP(&H3C9)
NEXT n
OPEN Filename$ FOR BINARY AS #1
PUT #1, , FileTYPE$
PUT #1, , FileSize&
PUT #1, , Reserved1% 'should be zero
PUT #1, , Reserved2% 'should be zero
PUT #1, , OffsetBITS&
PUT #1, , InfoHEADER&
PUT #1, , PictureWIDTH&
PUT #1, , PictureDEPTH&
PUT #1, , NumPLANES%
PUT #1, , BPP%
PUT #1, , Compression&
PUT #1, , ImageSIZE&
PUT #1, , WidthPELS&
PUT #1, , DepthPELS&
PUT #1, , NumCOLORS&
PUT #1, , SigCOLORS& '51 to 54
u$ = " "
FOR n% = 1 TO 768 STEP 3 'PUT as BGR order colors
Colr$ = CHR$(FileCOLORS%(n% + 2) * 4)
PUT #1, , Colr$
Colr$ = CHR$(FileCOLORS%(n% + 1) * 4)
PUT #1, , Colr$
Colr$ = CHR$(FileCOLORS%(n%) * 4)
PUT #1, , Colr$
PUT #1, , u$ 'Unused byte
NEXT n%
FOR y = y2% TO y1% STEP -1 'place bottom up
FOR x = x1% TO x2%
a$ = CHR$(POINT(x, y))
Colors8%(ASC(a$)) = 1
PUT #1, , a$
NEXT x
PUT #1, , ZeroPAD$
NEXT y
FOR n = 0 TO 255
IF Colors8%(n) = 1 THEN SigCOLORS& = SigCOLORS& + 1
NEXT n
PUT #1, 51, SigCOLORS&
CLOSE #1
END SUB
In your MAIN module SUB call:
You can use a certain keypress to trigger a snapshot of the screen.
The filename can just be the first name as SUB will add ".BMP" if needed. You could also add a snapshot number to the name for more bitmaps. Screen 13 does it pretty fast.
x1 and x2 can be from 0 to 319, y1 and y2 from 0 to 199 respectively.
I also have a SUB for SCREEN 12 that may take up to 8 seconds to create a fullscreen snapshot.
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
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
- coma8coma1
- Veteran
- Posts: 100
- Joined: Sat Dec 08, 2007 5:29 pm
- Location: Maryland, USA
oh man that's great! I'll give it try later and then maybe I can post some better screen shots of my project I'm working on. Right now the only recent screenshots I have were done with a digital camera where I took pictures of the screen! lol
thanks again. i'll give it a try later tonight or tomorrow.
thanks again. i'll give it a try later tonight or tomorrow.