MFC鼠标画图如何保存坐标
小小绿萝 2015-04-13 09:22:42 void CLi1View::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
m_pOrigin=point;
m_bDraw=TRUE;
CView::OnLButtonDown(nFlags, point);
}
void CLi1View::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
m_bDraw=FALSE;
CView::OnLButtonUp(nFlags, point);
}
void CLi1View::OnMouseMove(UINT nFlags, CPoint point)
{
//TODO: Add your message handler code here and/or call default
CClientDC dc(this);
CPen pen(PS_SOLID,1,RGB(255,0,0));
CPen *pOldPen=dc.SelectObject(&pen);
if (m_bDraw==TRUE)
{
dc.MoveTo(m_pOrigin);
dc.LineTo(point);
m_pOrigin=point;
}
dc.SelectObject(pOldPen);
CView::OnMouseMove(nFlags, point);
}
新手求助:当鼠标画出任意的曲线的时候,怎样才能把所画曲线的坐标值存入一个数组中去呢