winApi一日一练之 SetTextColor (和Textout)函数
来源:互联网 发布:网络推广人员工资高吗 编辑:程序博客网 时间:2024/05/01 01:33
记得先要#include <iostream>////声明字符串std::wstring strShow(_T("Test String"));hdc = BeginPaint(hWnd, &ps);TextOut(hdc,10,30,strShow.c_str(),(int)strShow.length());SetTextColor(hdc,RGB(0,255,0));TextOut(hdc,10,60,strShow.c_str(),(int)strShow.length());SetTextColor(hdc,RGB(12,56,89));TextOut(hdc,10,80,strShow.c_str(),(int)strShow.length());// TODO: 在此添加任意绘图代码...EndPaint(hWnd, &ps);
drawText 调用示例:
////声明字符串std::wstring strShow(_T("Test String"));////声明一个矩形RECT rcText;rcText.left = 10;rcText.right=100;rcText.top = 20;hdc = BeginPaint(hWnd, &ps);DrawText(hdc,strShow.c_str(),(int)strShow.length(),&rcText,DT_LEFT|DT_SINGLELINE|DT_END_ELLIPSIS);SetTextColor(hdc,RGB(0,255,0));rcText.left = 10;rcText.top = 40;DrawText(hdc,strShow.c_str(),(int)strShow.length(),&rcText,DT_LEFT|DT_SINGLELINE|DT_END_ELLIPSIS);rcText.left = 10;rcText.top = 60;SetTextColor(hdc,RGB(12,56,89));DrawText(hdc,strShow.c_str(),(int)strShow.length(),&rcText,DT_LEFT|DT_SINGLELINE|DT_END_ELLIPSIS);// TODO: 在此添加任意绘图代码...EndPaint(hWnd, &ps);
- winApi一日一练之 SetTextColor (和Textout)函数
- winApi一日一练之 CreateSolidBrush(和FillRect)
- Windows API一日一练(22)TextOut函数
- Windows API一日一练(22)TextOut函数
- Windows API一日一练(22)TextOut函数
- Windows API一日一练(22)TextOut函数
- Windows API一日一练(22)TextOut函数
- Windows API一日一练(22)TextOut函数
- Windows API一日一练(22)TextOut函数
- Windows API一日一练(22)TextOut函数
- Windows API一日一练(22)TextOut函数
- Windows API一日一练(22)TextOut函数
- Windows API一日一练(22)TextOut函数
- Windows API一日一练(23)SetTextColor函数
- Windows API一日一练(23)SetTextColor函数
- Windows API一日一练(23)SetTextColor函数
- Windows API一日一练(23)SetTextColor函数
- Windows API一日一练(23)SetTextColor函数
- Delphi 实现窗体无标题栏有边框
- SQL手工注入大全
- 交叉编译ARM版 Qt (qt-everywhere-opensource-src-4.7.3)
- java数组实现约瑟夫
- Flex使用弹出窗口为DataGrid添加新数据
- winApi一日一练之 SetTextColor (和Textout)函数
- 针对上传木马找不到名字的解决办法
- ActiveMQ 安装、测试全过程
- 从网络开始
- MyEclipse9下开发Hibernate实例
- c++学习札记(三)
- 利用PE结构给Windows可执行程序加密码
- VFS之mount函数分析
- XPCOM开发实例