Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
Article Q78888, Example 3
◄Contents► ◄Index► ◄Back►
─────────────────────────────────────────────────────────────────────────────
◄Knowledge Base Contents► ◄Knowledge Base Index►
How to Save Color Registers After BSAVE of (PICEM) Graphics, Example 3
Example 3: (SAV13.BAS)
----------------------
To try this example in VBDOS.EXE:
1. From the File menu, choose New Project.
2. Copy the code example to the Code window.
3. Press F5 to run the program.
' To run this program in the environment, you must invoke the
' environment with the /L switch to load the default Quick library:
' VBDOS.EXE /L for Visual Basic 1.0 for MS-DOS
'
' REQUIREMENT: Must have PICEM210.EXE.
' This program uses PICEM210 to display a .PCX, .PIC, or .GIF
' file onto the screen so that Visual Basic for MS-DOS can then
' BSAVE it. It BSAVEs the picture and the color registers for SCREEN
' 13. The value of the variable YOURFILE must be written into
' the code. PICEM210.EXE should be in the default directory.
DECLARE SUB ConvrtPic ()
TYPE colortype
red AS STRING * 1
green AS STRING * 1
blue AS STRING * 1
END TYPE
' Use the following include file for Visual Basic 1.0 for MS-DOS:
REM $INCLUDE: 'VBDOS.BI'
CALL ConvrtPic()
END
SUB Convrt Pic()
DIM inregsx AS RegTypeX
DIM outregsx AS RegTypeX
DIM colorbuf(255) AS colortype
SCREEN 13
SHELL "PICEM210 /e/v:l YOURFILE.pcx"
' Where YOURFILE.pcx is the filename of the pcx, .pic, or .gif
' graphics image to be converted.
' BSAVE graphics image.
DEF SEG = &HA000
BSAVE "YOURFILE.sav", 0, 64000
' Where YOURFILE is the filename for the converted graphic image.
DEF SEG
' ROM BIOS interrupt to get palette registers.
inregsx.ax = &H1017
inregsx.bx = 0
inregsx.cx = 256
inregsx.es = VARSEG(colorbuf(0))
inregsx.dx = VARPTR(colorbuf(0))
CALL INTERRUPTX(&H10, inregsx, outregsx)
' BSAVE palette registers.
DEF SEG = VARSEG(colorbuf(0))
BSAVE "YOURFILE.reg", VARPTR(colorbuf(0)), 3 * 256
' Where YOURFILE is the filename for the BSAVEd color registers.
DEF SEG
END SUB