The CreateSolidBrush function creates a logical brush that has the specified solid color.
If the function succeeds, the return value identifies a logical brush.
If the function fails, the return value is NULL.
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.
For an example, see Creating Colored Pens and Brushes.
Minimum supported client
|Windows 2000 Professional [desktop apps only]|
Minimum supported server
|Windows 2000 Server [desktop apps only]|
- Brushes Overview
- Brush Functions
Build date: 6/12/2013