community.borland.com

Article #15787: REVERSE VIDEO WITH GRAPH UNIT

 Technical Notes Database

TN787D.txt   REVERSE VIDEO WITH GRAPH UNIT
Category   :Pascal
Platform    :All
Product    :Turbo Pascal  4.0+

Description:
Q. How do you reverse the background color with the foreground
   color with the Graph unit routines?
A. To create reverse video in graphics mode:

     1. Set the background color: SetBkColor(6).  The background
        color is now brown.
     2. Set the palette so that the background and foreground
        colors won't be the same: SetPalette(6,0).
     3. Set the foreground color: SetColor(6).

   To restore, either:

      1. Use GetPalette(P) before creating reverse video and
         restore with SetPalette(P), or
      2. a) Set the background color: SetBkColor(0).  The
            background color is back to black.
         b) Return the palette to its original state:
            SetPalette(6,20).

   Note that these procedures work only in graphics mode.


Reference:


7/16/98 4:35:35 PM
 

Last Modified: 01-SEP-99