怎么用SetROP2(R2_NOTXORPEN)擦除不了先前画的矩形??
在MFC 鼠标移动事件响应如下:
void CMoveWindowTestDlg::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if (m_isCapture==TRUE)
{
m_hasPicture=TRUE;
CClientDC dc(this);
CPen pen(PS_SOLID,1,RGB(255,0,0));
DeleteObject(dc.SelectObject(pen));
int drawMode=dc.SetROP2(R2_NOTXORPEN);
m_endPoint.x=point.x;
m_endPoint.y=point.y;
dc.MoveTo(m_startPoint);
dc.LineTo(m_endPoint.x,m_startPoint.y);
dc.LineTo(m_endPoint.x,m_endPoint.y);
dc.LineTo(m_startPoint.x,m_endPoint.y);
dc.LineTo(m_startPoint.x,m_startPoint.y);
/*dc.LineTo(point);*/
//dc.SetROP2(drawMode);
}
CDialog::OnMouseMove(nFlags, point);
}
怎么执行后没擦除先前画的矩形 望高手解释下