在OnPaint函数里
CPointDC dc(this);
CBrush rBrush;
rBrush.CreateSolidBrush(RGB(255,0,0));
dc.SetBkMode(0);//设置0或1的效果都一样啊?
CRgn r;
r.CreatePolygonRgn(Point,6,1);
dc.FillRgn(&r,&rBrush);
r.DeleteObject();
dc.DrawText(Point,rect,0x25);
rBrush.DeleteObject();
解决方案 »
- 关于画图和颜色的新手问题 求教
- 如何建立一个无运行界面的,可显示日志的MFC程序
- 为何GetParent()无法获取父窗口指针
- 关于创建控制台
- -----请教如何获取CEdit中的数据?------
- Cannot open include file: 'libcpp.h': No such file or directory(这个问题怎么解决)立即结贴
- 如何找到VC++数字音频技术开发方面的书籍
- 关于C++分析HTML并提取重复结构~求助~
- 构造函数为虚函数,执行起来怎么样
- 我突然间有一个想法,能不能获得某个象素的信息??欢迎大家来讨论!!
- 为窗体添加加载事件
- tab自绘//不知道添加什么函数每个标签变成一个窗口?
OPAQUE 是 20不知是什么
This method sets the background mode. The background mode defines whether the system removes background colors on the drawing surface before drawing text, hatched brushes, or any pen style that is not a solid line.int SetBkMode(
int nBkMode );
Parameters
nBkMode
The mode to set. This parameter can be either of the following values:
OPAQUE Background is filled with the background color before the text, hatched brush, or pen is drawn. This is the default background mode.
TRANSPARENT Background is not changed before drawing.
看看msdn上说的,你写一个0是什么意思?
#define TRANSPARENT 1
#define OPAQUE 2
#define BKMODE_LAST 2只有1和2