Microsoft KB Archive/30545

QuickC 1.01 README.DOC: Colors in Graphics/Text Mode PSS ID Number: Q30545 Article last modified on 10-12-1988 PSS database name: S_QuickC

1.01

MS-DOS

Summary: Some of the following information is from the Microsoft QuickC Version 1.01 README.DOC file. However, due to an omission in the QuickC Version 1.01 README.DOC, the information titled “Colors in Graphics and Text Modes” is from the Microsoft C Version 5.10 README.DOC file.

More Information: The following notes refer to specific pages in the Microsoft C Optimizing Compiler Run-Time Library Reference:

Page 514 _setbkcolor, _setcolor Page 314 _getbkcolor Page 51 Colors in Graphics and Text Modes

In a color text mode (such as _TEXTC80), _setbkcolor accepts (and _getbkcolor returns) an attribute, or pixel value. The value for the default colors is given by the table in Section 4.4 of the QuickC programmer’s guide. For example, _setbkcolor(2L) sets the background color to pixel value 2. The actual color displayed depends on the palette mapping for pixel value 2. The default is green in a color text mode. In a color-graphics mode (such as _ERESCOLOR), _setbkcolor accepts (and _getbkcolor returns) a color (as used in _remappalette). The value for the background color is given by the manifest constants defined in the GRAPH.H include file. For example, _setbkcolor(_GREEN) sets the background color in a graphics mode to green. These manifest constants are provided as a convenience in defining and manipulating the most common colors. The actual range of colors is, in general, much greater. The function _setcolor accepts an int value as an argument. It is an attribute or pixel value. In general, whenever an argument is long, it refers to a color, and whenever it is short, it refers to an attribute or pixel value. The two exceptions are _setbkcolor and _getbkcolor described above.

Copyright Microsoft Corporation 1988.