vbdpss.hlp (Table of Contents; Topic list)
Article Q78888
                                                 Contents  Index  Back
─────────────────────────────────────────────────────────────────────────────
                           Knowledge Base Contents  Knowledge Base Index
 
 How to Save Color Registers After BSAVE of (PICEM) Graphics - Q78888
 
 Visual Basic for MS-DOS version 1.0 cannot directly use .PCX, .GIF, or
 .PIC graphics files. The PICEM210.EXE utility can be used to display
 the graphics on the screen so that Visual Basic for MS-DOS can BSAVE
 and later BLOAD the image. However, the BSAVE statement only saves the
 bit planes, not the color registers. If the graphics image changes the
 color registers, then these changes will be lost, resulting in a
 gray-scale image when loaded with the BLOAD statement. This is a
 limitation of the BSAVE statement, not PICEM210.EXE.
 
 In order to retain the picture's original colors, use the
 CALL INTERRUPTX &H10 with function &H17 to place the color registers
 into an array, then BSAVE the array. To restore the picture's colors,
 BLOAD the color register array that was saved with BSAVE and use
 CALL INTERRUPTX &H10 with function &H12.
 
 Of the four sample programs provided below, examples 1 and 3 BSAVE the
 picture and its color registers, and examples 2 and 4 BLOAD the
 picture and its color registers.
 
 PICEM210 is a freeware graphics file viewing utility that can display
 .GIF, .PCX, and .PIC file formats, and is required to make these
 programs run. PICEM210 is available as a freeware product from
 CompuServe. For more information on PICEM, please read its README
 file, PICEM210.DOC found on CompuServe.
 
 More Information:
 
 Example program 1 or 3 only need to be used once to convert the
 graphics image. Example program 2 or 4 need to be used every time you
 wish to display the graphics image.
 
 The examples can be used independently. If you add them to an existing
 program, the DECLARE SUB ConvrtPic(), the TYPE colortype ... END TYPE,
 and 'INCLUDE: 'VBDOS.BI' statements must be moved to the existing
 program's main module level code. The introduction on each example
 lists which variables need to be altered by the programmer. The
 programs themselves contain suggested values for the variables when
 necessary.
 
    See Example 1:  SAV7TO12.BAS
    See Example 2:  LOD7TO12.BAS
    See Example 3:  SAV13.BAS
    See Example 4:  LOD13.BAS