2.4.1 Setting Colors

Line output can be solid or broken (dashed, dotted, or a combination of the two). If it is broken, the space between the breaks can be filled by setting the background mode to OPAQUE and selecting a color. By setting the background mode to TRANSPARENT, the space between breaks is left in its original state. The SetBkMode and SetBkColor functions set the background mode and color.

Brush output is solid, patterned, or hatched. The space between hatch marks can be filled by setting the background mode to OPAQUE and selecting a color. When Windows creates brush output on a display, it combines the existing color on the display surface with the brush color to yield a new and final color; this is a binary raster operation. If the default raster operation is not appropriate, a new one is chosen by using the SetROP2 function.

The appearance of text output is limited only by the number of available fonts and the color capabilities of the output device. The SetBkColor function sets the color of the text background (the unused portion of each character cell), and the SetTextColor function sets the color of the character itself.