The GrayString function draws gray text at the specified location. The function draws the text by copying it into a memory bitmap, graying the bitmap, and then copying the bitmap to the screen. The function grays the text regardless of the selected brush and background. GrayString uses the font currently selected for the specified device context.
If the lpOutputFunc parameter is NULL, GDI uses the TextOut function, and the lpData parameter is assumed to be a pointer to the character string to be output. If the characters to be output cannot be handled by TextOut (for example, the string is stored as a bitmap), the application must supply its own output function.
BOOL GrayString(
HDC hDC, |
// handle to the device context |
HBRUSH hBrush, |
// handle to the brush for graying |
GRAYSTRINGPROC lpOutputFunc, |
// pointer to the callback function |
LPARAM lpData, |
// pointer to application-defined data |
int nCount, |
// number of characters to output |
int X, |
// horizontal position |
int Y, |
// vertical position |
int nWidth, |
// width |
int nHeight |
// height |
); |
If the string is drawn, the return value is nonzero.
If either the TextOut function or the application-defined output function returned zero, or there was insufficient memory to create a memory bitmap for graying, the return value is zero. To get extended error information, call GetLastError.
Without calling GrayString, an application can draw grayed strings on devices that support a solid gray color. The system color COLOR_GRAYTEXT is the solid-gray system color used to draw disabled text. The application can call the GetSysColor function to retrieve the color value of COLOR_GRAYTEXT. If the color is other than zero (black), the application can call the SetTextColor function to set the text color to the color value and then draw the string directly. If the retrieved color is black, the application must call GrayString to gray the text.
DrawText, GetSysColor, OutputProc, SetTextColor, TabbedTextOut, TextOut
file: /Techref/os/win/api/win32/func/src/f44_10.htm, 6KB, , updated: 2000/4/7 12:19, local time: 2024/10/3 04:21,
35.171.164.77:LOG IN ©2024 PLEASE DON'T RIP! THIS SITE CLOSES OCT 28, 2024 SO LONG AND THANKS FOR ALL THE FISH!
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://massmind.org/techref/os/win/api/win32/func/src/f44_10.htm"> GrayString</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to massmind.org! |
.