PRB: Area Around Text and Remainder of Window Different ColorsLast reviewed: November 2, 1995Article ID: Q22242 |
The information in this article applies to:
SYMPTOMSWhen text is painted into a window, an area around the text is a different color than the remainder of the window.
CAUSEThe area around the text is painted with a solid color while the remainder of the window is painted using a dithered color.
RESOLUTIONTo make the area around the text and the remainder of the window have the same color, perform one of the following two steps:
MORE INFORMATIONBy default, when an application paints text into its window, Windows fills the area around the character with the current background color. Windows always uses a solid color for this purpose. When an application registers a window class, it specifies a handle to a brush that Windows uses to paint the window background. On some output devices, brushes can create dithered colors. On one of these devices, the area behind painted text might have a different color than the remainder of the window. The following code specifies the window background color:
#define ELANGREEN 0x003FFF00 pTemplateClass->hbrBackground = CreateSolidBrush((DWORD)ELANGREEN);The following code specifies the color used to paint around text and draws some text into a device context:
#define SZ -1 SetBkColor(hDC, (DWORD)ELANGREEN); DrawText(hDC, (LPSTR)"text", SZ, (LPRECT)&Rect, DT_BOTTOM);The color used to paint the area around the text has a yellow cast, which gives it a slightly different appearance than the window background color. A brush may be able to represent a wider color range than the solid colors because a brush covers an area while a solid color may be used to paint nominal-width lines (for example, lines that are one device unit wide) that must be the same color at all locations and angles. Therefore, the device-driver writer has the option of providing dithered colors for brushes, but has no such freedom when it comes to the solid colors for drawing lines.
|
Additional reference words: 3.00 3.10 3.50 4.00 95
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |