The CreateSolidBrush function creates a logical brush that has the specified solid color.
HBRUSH CreateSolidBrush(
COLORREF color
);
| Parameter | Description |
|---|---|
color |
The red, green, blue (RGB) color value for the brush. This parameter is a 32-bit value that specifies the intensity of red, green, and blue, respectively. The high byte is unused, the next byte contains red, the next byte contains green, and the low byte contains blue. This parameter can be a standard color value, or a custom RGB value. For example:
RGB(255, 0, 0) // Pure red
|
If the function succeeds, the return value is a handle to the newly created logical brush.
If the function fails, the return value is NULL.
To get extended error information, call GetLastError.
A logical brush is a graphics object used to paint the interior of polygons, rectangles, ellipses, and other closed shapes. It can also be used to draw lines and curves.
The CreateSolidBrush function creates a brush that uses a specified solid color. The color is defined by the color parameter, which is a 32-bit RGB value.
After you are finished with the brush, you must delete it by calling the DeleteObject function.
| Attribute | Value |
|---|---|
| Minimum supported client | Windows 2000 Professional |
| Minimum supported server | Windows 2000 Server |
| Header | wingdi.h (include Windows.h) |
| Library | Gdi32.lib |
| DLL | Gdi32.dll |
Brushes, CreateBrushIndirect, DeleteObject, SelectObject, LOGBRUSH Structure