当我在静态控件中双击时,我将在静态控件中的鼠标位置绘制椭圆。(MFC);但是,看起来:
我的代码:
无效 CTreeShowLabel::OnLButtonDblClk(UINT nFlags, CPoint 点)
{
//设置画笔
COLORREF 黑色 = RGB(255, 0, 0);
CPen笔(PS_SOLID,1,黑色);
CClientDC Dc(GetDlgItem(IDC_TREESTATIC));
Dc.SelectObject(笔);
//在鼠标处画图
CPoint curPos;
GetCursorPos(&curPos);
CPoint point1(0,0);
point1.x = curPos.x - 50;
point1.y = curPos.y - 50;
CPoint point2(0,0);
point2.x = curPos.x + 50;
point2.y = curPos.y + 50;
//画圆
Dc.Ellipse(CRect(point1, point2));
CStatic::OnLButtonDblClk(nFlags, point);
}
关于圈子是可怕的。