16,471
社区成员
发帖
与我相关
我的任务
分享
void CSketcherView::OnLButtonUp(UINT nFlags, CPoint point)
{
// Make sure there is an element
if (m_pTempElement)
{
// Add the element pointer to the sketch
GetDocument()->AddElement(m_pTempElement);
InvalidateRect(&m_pTempElement->GetEnclosingRect());
m_pTempElement.reset(); // Reset the element pointer
}
}
void CSketcherView::OnDraw(CDC* pDC)
{
CSketcherDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
// Draw the sketch
for (const auto& pElement : *pDoc)
{
if (pDC->RectVisible(pElement->GetEnclosingRect()))
pElement->Draw(pDC);
}
}
这个是不是并没有用到WM_PAINT消息的update region信息呀?如果是的话,那么怎么利用这个update region信息呢?