HBRUSH to RGB value

GetObject函数返回一个LOGBRUSH结构体,包含了COLORREF结构。

LOGBRUSH lgbrush;
COLORREF color;
GetObject((HBRUSH)GetStockObject(WHITE_BRUSH), sizeof(LOGBRUSH), &lgbrush);
color=lgbrush.lbColor;

参考链接

GetObject function          https://msdn.microsoft.com/en-us/library/windows/desktop/dd144904(v=vs.85).aspx

LOGBRUSH structure    https://msdn.microsoft.com/en-us/library/windows/desktop/dd145035(v=vs.85).aspx

 

posted @ 2017-08-19 12:21  ,,,沙子,,,  阅读(411)  评论(0编辑  收藏  举报