VC++重绘问题,第一个InvalidateRect(pDoc->m_rectEllipse);为什么说是擦除原来位置的椭圆?求高手解答!
voidCMyView::OnMouseMove(UINTnFlags,CPointpoint){//TODO:Addyourmessagehandlercodehere...
void CMyView::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CMyDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if(pDoc->m_bCaptured)
{
InvalidateRect(pDoc->m_rectEllipse);
CSize offset(point-pDoc->m_pointMouse);
pDoc->m_rectEllipse += offset;
InvalidateRect(pDoc->m_rectEllipse);
pDoc->m_pointMouse = point;
}
CView::OnMouseMove(nFlags, point);
} 展开
{
// TODO: Add your message handler code here and/or call default
CMyDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if(pDoc->m_bCaptured)
{
InvalidateRect(pDoc->m_rectEllipse);
CSize offset(point-pDoc->m_pointMouse);
pDoc->m_rectEllipse += offset;
InvalidateRect(pDoc->m_rectEllipse);
pDoc->m_pointMouse = point;
}
CView::OnMouseMove(nFlags, point);
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询