一个你一定能很快写出代码来的问题. 画图问题.画出的笔划就是一副位图.不能用LOGBRUSH结构体,忘记怎么搞了,记得就几句代码的.请把代码写给我吧.别讲太原理的东西.我知道关键是那支画笔.谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 void DrawARectangle(HDC hdc) { HPEN hpen, hpenOld; HBRUSH hbrush, hbrushOld; // Create a green pen. hpen = CreatePen(PS_SOLID, 10, RGB(0, 255, 0)); // Create a red brush. hbrush = CreateSolidBrush(RGB(255, 0, 0)); // Select the new pen and brush, and then draw. hpenOld = SelectObject(hdc, hpen); hbrushOld = SelectObject(hdc, hbrush); Rectangle(hdc, 100,100, 200,200); // Do not forget to clean up. SelectObject(hdc, hpenOld); DeleteObject(hpen); SelectObject(hdc, hbrushOld); DeleteObject(hbrush);}能满意不? TO:pomelown,你的仍然是填充矩形,画出来的笔划仍然只有那支green pen.TO: vcmute,是dc.SelectObject(hBitmap)吗,如果这样的话,怎么一点反应也没有? 不是画笔是刷子把?你的意思是把Brush设置成一个位图? 算是看懂了。你去看深入浅出MFC的例程吧。不过你对“位图”的概念有问题,至少表述得有问题 谢谢大家,还是搞不定.我用一种投机取巧的方法实现了.在鼠标移动事件中,不断地调用FillRect方法,看上去有点别扭,但也勉强凑合了.无奈之举,呵呵 Shell扩展-点击AVI文件的系统右键菜单无法创建 UNICODE和MBCS的问题,无法向文本文件中写入汉字 如何在我接收到的视频数据里叠加指定的图标 如何使数据库一表内容全部显示 如何实现象输入法控制一样的图标 请详细一点回答 我水平实不高 怎么用VC写一个从http上下载一文件,谢谢, ???如何将哦ondraw中画的图像画到内存中 一个关于校验和的问题 关于__stdcall 与 __cdecl 的问题。 关于NTFS和病毒,请教一下! 用socket 实现udp协议? 一个最简单的XML文件,为其写一个XSL文件,请指教
{
HPEN hpen, hpenOld;
HBRUSH hbrush, hbrushOld; // Create a green pen.
hpen = CreatePen(PS_SOLID, 10, RGB(0, 255, 0));
// Create a red brush.
hbrush = CreateSolidBrush(RGB(255, 0, 0)); // Select the new pen and brush, and then draw.
hpenOld = SelectObject(hdc, hpen);
hbrushOld = SelectObject(hdc, hbrush);
Rectangle(hdc, 100,100, 200,200); // Do not forget to clean up.
SelectObject(hdc, hpenOld);
DeleteObject(hpen);
SelectObject(hdc, hbrushOld);
DeleteObject(hbrush);
}能满意不?
TO: vcmute,是dc.SelectObject(hBitmap)吗,如果这样的话,怎么一点反应也没有?
我用一种投机取巧的方法实现了.
在鼠标移动事件中,不断地调用FillRect方法,看上去有点别扭,但也勉强凑合了.
无奈之举,呵呵