Capturing Paintbrush and FRIEZE Screens with QuickBasic BSAVE (35147)



The information in this article applies to:

  • Microsoft QuickBASIC 4.0
  • Microsoft QuickBASIC 4.0b
  • Microsoft QuickBASIC 4.5
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
  • Microsoft Basic Professional Development System for MS-DOS 7.0

This article was previously published under Q35147

SUMMARY

With the Microsoft Mouse Paintbrush package you can create graphic images that can be displayed on the screen with the FRIEZE terminate-and-stay resident program. This article explains how to save a copy of a Paintbrush graphic image in a form that can be used in Microsoft Basic.

You can invoke FRIEZE with hardware interrupt 5 from a Microsoft Basic program. With FRIEZE versions 7.25 and earlier, you can load a Paintbrush image into video memory. The BSAVE statement in Basic lets you write a video memory image into a disk file, which can be used by the Basic BLOAD command. BLOAD lets you load images from a BSAVE-format disk file back into video memory.

This information only applies to FRIEZE versions 7.25 and earlier. This article does not apply to FRIEZE versions 8.05 or later, which do not have a load option.

An easier technique to create BLOAD format graphics files (from file formats used by a variety of graphics programs) is to use the PICEM.EXE freeware program. PICEM.EXE is described in a separate article, which can be found by querying for the following words:

PICEM and freeware

MORE INFORMATION

The following steps demonstrate this process:

  1. Load the FRIEZE program into memory. (FRIEZE is a TSR, a terminate-and-stay-resident program, provided with the Microsoft Mouse PaintBrush program.)
  2. Run Basic Program 1 (below), which invokes hardware interrupt number 5. This interrupt activates FRIEZE, which appears as a horizontal menu in the upper-left corner of the screen. Execution of Basic Program 1 is now suspended by the interrupt.
  3. Using the Load option in the FRIEZE menu, load the desired PaintBrush image.
  4. Immediately after the image loads, the Basic Program 1 automatically resumes running and executes the BSAVE statement. The BSAVE statement saves the current screen to a disk file. Program 1 then stops.
  5. You may run Program 2 at any later time to display the image that is stored in the IMAGE.PIC disk file.

Code Examples

Program 1

   REM The QB.BI definition file is found on the QuickBasic release disk:
   REM For Basic Compiler 7.00 and QBX.EXE you must include 'QBX.BI'
   REM $INCLUDE: 'qb.bi'
   DIM regs AS RegType
   SCREEN 3   ' Use SCREEN 3 for Hercules display adapter.
   CALL INTERRUPT(&H5, regs, regs)   ' Invokes hardware interrupt 5.
   DEF SEG = &HB000 ' Monochrome video memory starts at address &HB000
   ' If you have a CGA display, change the previous SCREEN and DEF SEG
   ' statements to the following:
   ' SCREEN 1
   ' DEF SEG = &HB800  ' Starting Video memory address for CGA is &HB800
   BSAVE "image.pic", 0, 32767
   DEF SEG   ' Returns segment pointer to default data segment.
				

Program 2

   SCREEN 3   ' Use SCREEN 3 for Hercules display adapter.
  SCREEN 3   ' Use SCREEN 3 for Hercules display adapter.
   DEF SEG = &HB000
   ' If you have a CGA, change the previous two statements to the
   ' following:
   ' SCREEN 1
   ' DEF SEG = &HB800
   BLOAD "image.pic", 0
   DEF SEG
				

Modification Type:MinorLast Reviewed:8/16/2005
Keywords:KB35147