Reputation: 93
Can you get the RGB value from HBRUSH
or from brush id? for example: I'm looking for GRAY_BRUSH
in RGB value.
Upvotes: 8
Views: 3597
Reputation: 41
static COLORREF lbColor;
HBRUSH hb = GetSysColorBrush(COLOR_BACKGROUND);
LOGBRUSH br = { 0 };
if (GetObject(hb, sizeof(br), &br))
{
lbColor = br.lbColor;
RGBQUAD rgbq = { 0 };
rgbq.rgbBlue = GetBValue(lbColor);
rgbq.rgbGreen = GetGValue(lbColor);
rgbq.rgbRed = GetRValue(lbColor);
rgbq.rgbReserved = 0;
//...
}
Upvotes: 2