Microsoft KB Archive/35147
Article ID: 35147
Article Last Modified on 11/21/2006
- Microsoft QuickBasic 4.0
- Microsoft QuickBASIC 4.0b
- Microsoft QuickBasic 4.5 for MS-DOS
- Microsoft BASIC Compiler 6.0
- Microsoft BASIC Compiler 6.0b
- Microsoft BASIC Professional Development System 7.0
This article was previously published under Q35147
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
The following steps demonstrate this process:
- Load the FRIEZE program into memory. (FRIEZE is a TSR, a terminate-and-stay-resident program, provided with the Microsoft Mouse PaintBrush program.)
- 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.
- Using the Load option in the FRIEZE menu, load the desired PaintBrush image.
- 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.
- You may run Program 2 at any later time to display the image that is stored in the IMAGE.PIC disk file.
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.
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
Additional query words: QuickBas BasicCom