Microsoft KB Archive/40152

= How to Incorporate Paintbrush (PCX) EGA File into QB SCREEN 9 =

Article ID: 40152

Article Last Modified on 11/21/2006



This article was previously published under Q40152



SUMMARY
Microsoft QuickBasic can incorporate PCX files created with the Microsoft Mouse Paintbrush package through the use of the FRIEZE terminate-and-stay-resident (TSR) program. The FRIEZE TSR is included in the Microsoft Mouse Paintbrush package and can be loaded up into memory by running the PAINT.BAT file located on the Microsoft Mouse Utilities distribution disk. The steps you should first take are as follows:


 * 1) Load the FRIEZE TSR into memory from within a batch file.
 * 2) Load your QuickBasic program, which will issue an interrupt 5. This makes the TSR active, allowing you to load a PCX file from disk into the video-card memory.

Your QuickBasic program then can BSAVE the four EGA planes--red, green, blue, and intensity--out to disk. This makes it possible to include high quality, color pictures in QuickBasic programs.

This information applies to Microsoft QuickBasic Versions 4.00, 4.00b, and 4.50 for MS-DOS and Microsoft Basic Compiler Versions 6.00 and 6.00b and Microsoft Basic PDS 7.00 for MS-DOS and MS OS/2.



MORE INFORMATION
The following is a code example: +++++++++++++++++++++++++++++++++++ EGAPBSAV.BAS +++++++++++++++++++++++++++++++++++

REM If you are using Basic PDS 7.00, change the include file REM below to 'QBX.BI'.

REM $INCLUDE: 'QB.BI' DIM REGS AS RegType DIM SHARED TOTALVIDEOMEM AS INTEGER DIM SHARED FILNAME$

TOTALVIDEOMEM=28000 SCREEN 9 COLOR 5,0 CLS PRINT &quot;MAKE SURE THAT YOU HAVE LOADED THE FRIEZE TSR INTO MEMORY BEFORE&quot; PRINT &quot;RUNNING THIS PROGRAM.&quot; PRINT CALL SAVEPCXFILE END

SUB SAVEPCXFILE STATIC DIM REGS AS REGTYPE PRINT : PRINT PRINT &quot;WHAT BASE NAME WOULD YOU LIKE TO GIVE THE BINARY IMAGE FILE?&quot; PRINT &quot;PLEASE DO NOT PROVIDE AN EXTENSION (e.g. .BAS OR .BIN)&quot; PRINT INPUT &quot;FILENAME: &quot;,FILENAME$ PRINT &quot;PRESS ANY KEY TO BRING UP THE FRIEZE TSR....&quot; SLEEP CALL INTERRUPT(&H5,REGS,REGS) DEF SEG=&HA000 FOR I=0 TO 3 'SET EGA REGISTER FOR A READ FROM EACH PLANE OUT &H3CE,4 OUT &H3CF,I TEMP$=RTRIM$(FILENAME$)+LTRIM$(STR$(I))+&quot;.EGA&quot; BSAVE TEMP$,0,TOTALVIDEOMEM NEXT I DEF SEG END SUB

Additional query words: QuickBas BasicCom

Keywords: KB40152

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.