关于BEZIER曲线的问题

xxj2012xxj 2012-04-07 06:19:51
	case WM_LBUTTONDOWN:
case WM_RBUTTONDOWN:
case WM_MOUSEMOVE:
{
if (wParam & MK_LBUTTON || wParam & MK_RBUTTON)
{
hdc = GetDC(hwnd);
SelectObject(hdc, GetStockObject(WHITE_PEN));
DrawBezier(hdc, apt);

if (wParam & MK_LBUTTON)
{
apt[1].x = LOWORD(lParam);
apt[1].y = HIWORD(lParam);
}


if (wParam & MK_RBUTTON)
{
apt[2].x = LOWORD(lParam);
apt[2].y = HIWORD(lParam);
}

SelectObject(hdc, GetStockObject(BLACK_PEN));
DrawBezier(hdc, apt);
ReleaseDC(hwnd, hdc);
}
return 0;
}

上面是画BEZIER曲线的核心代码 我想知道的是里面的wParam 和 HIWORD(lParam) LOWORD(lParam) 具体是指的什么东西
是窗口的坐标吗?貌似能随时变化?
...全文
59 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
coolcoffee4051982 2012-04-07
  • 打赏
  • 举报
回复
鼠标的坐标。
schlafenhamster 2012-04-07
  • 打赏
  • 举报
回复
就是一个DWORD,所以不能大。具体是什么东西看帮助。
fwKeys = wParam; // key flags (虚拟键标记)
//
fwKeys
Value of wParam. Indicates whether various virtual keys are down. This parameter can be any combination of the following values: Value Description
MK_CONTROL Set if the ctrl key is down.
MK_LBUTTON Set if the left mouse button is down.
MK_MBUTTON Set if the middle mouse button is down.
MK_RBUTTON Set if the right mouse button is down.
MK_SHIFT Set if the shift key is down.
xxj2012xxj 2012-04-07
  • 打赏
  • 举报
回复
fwKeys = wParam; // key flags
是关键标志?什么意思。
在MSDN上搜了下wParam是这样解释的:The value of this field depends on the message. Use the wParam field to get information that is important to handling the message. This field is typically used to store small information such as flags.

按他是说明 是不是wParam 是跟着消息走的 当程序接受到一个消息时 wParam 就存储相应的数据以便于处理消息,最后一句to store small information such as flags.不太明白,什么是small information?
flags 具体是什么东西?



schlafenhamster 2012-04-07
  • 打赏
  • 举报
回复
在帮助中搜索“WM_MOUSEMOVE”:
WM_MOUSEMOVE
fwKeys = wParam; // key flags
xPos = LOWORD(lParam); // horizontal position of cursor
yPos = HIWORD(lParam); // vertical position of cursor
同理:
WM_LBUTTONDOWN
fwKeys = wParam; // key flags
xPos = LOWORD(lParam); // horizontal position of cursor
yPos = HIWORD(lParam); // vertical position of cursor

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧