
3个回答
展开全部
COLORREF SetTextColor(
HDC hdc,
COLORREF crColor
);
Parameters
hdc
[in] Handle to the device context.
crColor
[in] Value of type COLORREF that specifies the color of the text.
Return Values
A color reference for the previous text color indicates success. CLR_INVALID indicates failure. To get extended error information, call GetLastError.
以上内容摘自msdn.翻译如下:
函数原型:
COLORREF SetTextColor(
HDC hdc,
COLORREF crColor
);
参数:
hdc:
[输入]设备上下文句柄。
crColor
[输入] 声明要使用的文本颜色值,取值范围参见COLORREF
返回值:
返回颜色值说明调用成功,返回CLR_INVALID,说明调用失败,要得到出错信息,调用GetLastError()函数。
举个例子,
HDC dc;
dc.getDC();
SetTextColor(dc,0x00ffffff); //将字的颜色设为黑色。
HDC hdc,
COLORREF crColor
);
Parameters
hdc
[in] Handle to the device context.
crColor
[in] Value of type COLORREF that specifies the color of the text.
Return Values
A color reference for the previous text color indicates success. CLR_INVALID indicates failure. To get extended error information, call GetLastError.
以上内容摘自msdn.翻译如下:
函数原型:
COLORREF SetTextColor(
HDC hdc,
COLORREF crColor
);
参数:
hdc:
[输入]设备上下文句柄。
crColor
[输入] 声明要使用的文本颜色值,取值范围参见COLORREF
返回值:
返回颜色值说明调用成功,返回CLR_INVALID,说明调用失败,要得到出错信息,调用GetLastError()函数。
举个例子,
HDC dc;
dc.getDC();
SetTextColor(dc,0x00ffffff); //将字的颜色设为黑色。
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
dc->SetTextColor(RGB(255, 0, 0));
dc->SetTextColor(0x0000ff);
dc->SetTextColor(0x0000ff);
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你查MSDN啊?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询