CreateSolidBrush function
Applies to: desktop apps only
The CreateSolidBrush function creates a logical brush that has the specified solid color.
Syntax
HBRUSH CreateSolidBrush( __in COLORREF crColor );
Parameters
Return value
If the function succeeds, the return value identifies a logical brush.
If the function fails, the return value is NULL.
Remarks
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.
Examples
For an example, see Creating Colored Pens and Brushes.
Requirements
|
Minimum supported client | Windows 2000 Professional |
|---|---|
|
Minimum supported server | Windows 2000 Server |
|
Header |
|
|
Library |
|
|
DLL |
|
See also
- Brushes Overview
- Brush Functions
- CreateDIBPatternBrush
- CreateDIBPatternBrushPt
- CreateHatchBrush
- CreatePatternBrush
- DeleteObject
- GetSysColorBrush
- SelectObject
- COLORREF
- RGB
Send comments about this topic to Microsoft
Build date: 3/7/2012