我有一段鼠标随手绘图的程序(屏幕绘图),现在想实现内存绘图,但是不知道程序应该怎么写,写在哪里,请大家帮忙
void CNotepadView::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
m_bDraw=TRUE;
xTemp = point.x;
yTemp = point.y;
CEditView::OnLButtonDown(nFlags, point);
}
void CNotepadView::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
m_bDraw=FALSE;
CEditView::OnLButtonUp(nFlags, point);
}
void CNotepadView::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CPoint *pt;
CDC *pDC=GetDC();
HCURSOR m_HCross;
m_HCross=AfxGetApp()->LoadStandardCursor(IDC_CROSS);
SetCursor(m_HCross);
//鼠标画线
if(m_bDraw==TRUE)
{
CClientDC dc(this);
dc.MoveTo (xTemp,yTemp);
dc.LineTo (point.x,point.y);
xTemp = point.x;
yTemp = point.y;
pt = new CPoint(point.x,point.y);
m_ptrArray.Add(pt);
}
ReleaseDC(pDC);
CEditView::OnMouseMove(nFlags, point);
}