Pete's QBASIC Site Forum Index Pete's QBASIC Site
Return to Pete''s QBasic Site
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

screen shots?

 
Post new topic   Reply to topic    Pete's QBASIC Site Forum Index -> QBASIC Questions & Answers
View previous topic :: View next topic  
Author Message
iamdenteddisk



Joined: 30 Jun 2008
Posts: 62

PostPosted: Thu Jan 01, 2009 11:48 pm    Post subject: screen shots? Reply with quote

is ther one program available that can do screenshots in both Qb enviroments and in run enviroments it also be cool if it worked with windos xp programs too

the idea of using it for tutorials and doing ad's for my programs in website post would be cool..
_________________
iamdenteddisk@yahoo.com
Back to top
View user's profile Send private message
Kiyotewolf



Joined: 01 Apr 2008
Posts: 60

PostPosted: Sat Jan 03, 2009 4:01 am    Post subject: search cd_textfiles bbs ftp site Reply with quote

Search the graphics tools programs in the cd.textfiles site for screen capture programs, for DOS only, (which also works under DOSBOX.)

DOSBOX is very very handy because it lets you install TSR programs to do things like capture screens, while running under the Windows environment.

For Windows, just ALT-PrtScrn, or use a paint program that has a screen capture utility built in.

Kiyote!
_________________
Spriter ready to collaborate. kiyotewolf at gmail dot com
Back to top
View user's profile Send private message MSN Messenger
iamdenteddisk



Joined: 30 Jun 2008
Posts: 62

PostPosted: Sat Jan 03, 2009 5:28 pm    Post subject: ty Reply with quote

thanks!
_________________
iamdenteddisk@yahoo.com
Back to top
View user's profile Send private message
burger2227



Joined: 21 Aug 2006
Posts: 888
Location: Pittsburgh, PA

PostPosted: Sat Jan 03, 2009 6:14 pm    Post subject: Reply with quote

Here are QB SUBs for Eight Bit (screen 13) or Four Bit (Screen 12):

Code:
'**************************************************************
  '
  '----- BITMAP.BAS ---------------------------------------------
  '
  '----- Creates Windows bitmaps out of SCREEN 12/13 images -----
  '----- Windows bitmap file structure courtesy WOTSIT.ORG ------
  '--------- Freeware by Bob Seguin 2003 -- (TheBOB) ------------
  '
  '---- Decreased time of 4 bit fullscreen to 8 seconds ---------
  '               Ted Weissgerber July, 2008
  '- Add a special keypress to a program to create a Screenshot -
  '
  '**************************************************************
 

  DECLARE SUB FourBIT (x1%, y1%, x2%, y2%, Filename$)  '12 or 13 using 16 colors
  DECLARE SUB EightBIT (x1%, y1%, x2%, y2%, Filename$) '13 using 256 colors

  '******************* DEMO or your own program code ********************

  'Demonstrates CALLs to SUB programs (can make a screen shot of any program)
  'Maximum width value for x2% = 639 in Screen 12 or 319 in Screen 13
  'Maximum depth value for y2% = 479 in Screen 12 or 199 in Screen 13
  'Minimums for x1% and y1% can be no less than 0

  DO: CLS
  INPUT "ENTER Screen Mode 12 or 13 (0 quits): ", scrn%
  IF scrn% = 13 THEN
    SCREEN 13               '8 bit (256 colors) only
    LINE (0, 0)-(319, 199), 13, BF
    CIRCLE (160, 100), 50, 11
    PAINT STEP(0, 0), 9, 11
    Start! = TIMER
    EightBIT 0, 0, 319, 199, "Purple8"
  ELSEIF scrn% = 12 THEN
    SCREEN 12                 '4 bit(16 colors) only
    LINE (0, 0)-(639, 479), 13, BF
    LINE (100, 100)-(500, 400), 12, BF
    CIRCLE (320, 240), 100, 11
    PAINT STEP(0, 0), 9, 11
    Start! = TIMER
    FourBIT 0, 0, 639, 479, "Purple4"  '469, 239
  ELSE : SYSTEM
  END IF

  Finish! = TIMER
  PRINT "Elapsed time ="; Finish! - Start!; "secs."; "Press Escape to quit!"
  DO: K$ = INKEY$: LOOP UNTIL K$ <> ""
  LOOP UNTIL K$ = CHR$(27)
  SYSTEM
  '******************************** End DEMO code ************************

  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

'********************* Four Bit
  SUB FourBIT (x1%, y1%, x2%, y2%, Filename$)    'SCREEN 12 bitmap maker
                                       'fullscreen takes about 8 seconds
  DIM FileCOLORS%(1 TO 48)
  DIM Colors4%(0 TO 15)

  IF INSTR(Filename$, ".BMP") = 0 THEN
    Filename$ = RTRIM$(LEFT$(Filename$, 8)) + ".BMP"
  END IF
 
  FileTYPE$ = "BM"
  Reserved1% = 0
  Reserved2% = 0
  OffsetBITS& = 118
  InfoHEADER& = 40
  PictureWIDTH& = x2% - x1% + 1
  PictureDEPTH& = y2% - y1% + 1
  NumPLANES% = 1
  BPP% = 4
  Compression& = 0
  WidthPELS& = 3780
  DepthPELS& = 3780
  NumCOLORS& = 16

  IF PictureWIDTH& MOD 8 <> 0 THEN
    ZeroPAD$ = SPACE$((8 - PictureWIDTH& MOD 8) \ 2)
  END IF

  ImageSIZE& = (((PictureWIDTH& + LEN(ZeroPAD$)) * PictureDEPTH&) + .1) / 2
  FileSize& = ImageSIZE& + OffsetBITS&
 
  OUT &H3C7, 0                    'start at color 0
  FOR n = 1 TO 48 STEP 3
    FileCOLORS%(n) = INP(&H3C9)
    FileCOLORS%(n + 1) = INP(&H3C9)
    FileCOLORS%(n + 2) = INP(&H3C9)
  NEXT n

  OPEN Filename$ FOR BINARY AS #1
                                   'Header bytes
  PUT #1, , FileTYPE$                   '2 '1 to 2
  PUT #1, , FileSize&                   '4
  PUT #1, , Reserved1% 'should be zero  '2
  PUT #1, , Reserved2% 'should be zero  '2
  PUT #1, , OffsetBITS&                 '4
  PUT #1, , InfoHEADER&                 '4
  PUT #1, , PictureWIDTH&               '4
  PUT #1, , PictureDEPTH&               '4
  PUT #1, , NumPLANES%                  '2
  PUT #1, , BPP%                        '2
  PUT #1, , Compression&                '4
  PUT #1, , ImageSIZE&                  '4
  PUT #1, , WidthPELS&                  '4
  PUT #1, , DepthPELS&                  '4
  PUT #1, , NumCOLORS&                  '4
  PUT #1, , SigCOLORS&                  '4 '51 - 54

  u$ = " "             'unused byte
  FOR n% = 1 TO 46 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$ 'add Unused byte
  NEXT n%

  FOR y = y2% TO y1% STEP -1    'Place from bottom up
    FOR x = x1% TO x2% STEP 2   'nibble steps
      HiX = POINT(x, y): Colors4%(HiX) = 1     'added here
      LoX = POINT(x + 1, y): Colors4%(LoX) = 1
      HiNIBBLE$ = HEX$(HiX)
      LoNIBBLE$ = HEX$(LoX)
      HexVAL$ = "&H" + HiNIBBLE$ + LoNIBBLE$
      a$ = CHR$(VAL(HexVAL$))
      PUT #1, , a$
    NEXT x
    PUT #1, , ZeroPAD$
  NEXT y

  FOR n = 0 TO 15
    IF Colors4%(n) = 1 THEN SigCOLORS& = SigCOLORS& + 1
  NEXT n
  PUT #1, 51, SigCOLORS&        'new PUT

  CLOSE #1
  'BEEP         'optional sound if available for 4 bit only
  END SUB


Ted
_________________
Please acknowledge that you have read an answer!
QB64 is a FREE QBasic compiler for 32/64 bit WIN and LINUX PC's! : http://www.qb64.net/forum/
Get my Q-Basics demonstrator here (fast download): http://dl.dropbox.com/u/8440706/Q-Basics.zip
Back to top
View user's profile Send private message Send e-mail
iamdenteddisk



Joined: 30 Jun 2008
Posts: 62

PostPosted: Sat Jan 03, 2009 11:10 pm    Post subject: ty Reply with quote

thanks again burger!
_________________
iamdenteddisk@yahoo.com
Back to top
View user's profile Send private message
Yazar



Joined: 24 May 2008
Posts: 11

PostPosted: Wed Mar 04, 2009 5:02 am    Post subject: Reply with quote

if you check the INTERRUPTS you can see the 'PRINT SCREEN' interrupt. You can easily write a code and replace it with the original print screen interrupt and by the way you can get all dos? ss with Print screen key. Your new interrupt code should know the screen dimensions (ver, hor, depth) and you've to insert a bmp saving routinne. Also, there is an CLIPBOARD interrupt. You can use it for copiing and pasting image. While finishing your new interrupt code, don't forget to replace the original vector values...
Back to top
View user's profile Send private message
burger2227



Joined: 21 Aug 2006
Posts: 888
Location: Pittsburgh, PA

PostPosted: Wed Mar 04, 2009 2:00 pm    Post subject: HOW DO YOU LOOK AND SEE AN INTERRUPT Mr. Wizard? Reply with quote

NO ZAR! Print Screen will not work with fullscreen QB graphics screeens!

Q: Why don't you tell us the Interrupt? A: You don't know?

You CAN BSAVE the Screen 13 buffer to a binary file. The color RGB values would need to be combined in the upper part of the Image Array also.

Here is a link to the above "Snapshot.Zip" routine that creates bitmaps of screen 12 or 13.

http://www.qbasicstation.com/index.php?c=p_member&filecat=4

Ted
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Pete's QBASIC Site Forum Index -> QBASIC Questions & Answers All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
Protected by Anti-Spam ACP