windows_programming_notes.nbk: Home | Index | Next Page: CreateStreamOnHGlobal | Previous Page: CreateProcess
The CreateSolidBrush function creates a logical brush that has the specified solid color.
HBRUSH CreateSolidBrush( COLORREF crColor // brush color value );
If the function succeeds, the return value identifies a logical brush.
If the function fails, the return value is NULL.
Windows NT/2000/XP: To get extended error information, call GetLastError.
When you no longer need the HBRUSH object call the DeleteObject function to delete it.
A solid brush is a bitmap that the system uses to paint the interiors of filled shapes.
After an application creates a brush by calling CreateSolidBrush, it can select that brush into any device context by calling the SelectObject function.
To paint with a system color brush, an application should use [GetSysColorBrush](nIndex) instead of CreateSolidBrush([GetSysColor](nIndex)), because [GetSysColorBrush] returns a cached brush instead of allocating a new one.
ICM: No color management is done at brush creation. However, color management is performed when the brush is selected into an ICM-enabled device context.
windows_programming_notes.nbk: Home | Index | Next Page: CreateStreamOnHGlobal | Previous Page: CreateProcess
Notebook exported on Monday, 7 July 2008, 18:56:50 PM Eastern Daylight Time