我在旋转矩形时遇到闪烁,但在移动矩形时却没有,即使我使用的是相同的显示功能。这是一个楼层布局场景。
一些图像来说明。中心的红色矩形被选中并移动:
但是当尝试旋转时会发生以下情况:
用于旋转矩形的代码:
m_pDrawRect->SetRelativeAngle(point, m_pntLast, RECT_SELECTED | RECT_RECURSIVE);
m_pDrawRect->SetRelativePosition(point, m_pntLast, RECT_SELECTED |RECT_RECURSIVE);
CRecordDC dcRecord(m_pMemDC->GetDC(this, TRUE));
m_pDrawRect->Draw(&dcRecord, RECT_SELECTED);
m_pMemDC->Show(this);
表演功能:
Show(CWnd *pWnd)
{
CDC *pMainWnd=pWnd->GetDC();
pMainWnd->BitBlt(rcPaint.left, rcPaint.top, rcPaint.Width(), rcPaint.Height(), m_pMemDC, rcPaint.left, rcPaint.top, SRCCOPY);
pWnd->ReleaseDC(pMainWnd);