MFC 双缓冲机制,为何绘制不出来圆?
CDC* pDC=m_ground.GetDC();CDC memDC;
CRect Rect;
GetClientRect(&Rect);
memDC.CreateCompatibleDC(pDC);
CPen pen(NULL,2,RGB(0,0,0));
memDC.SelectObject(&pen);
//创建画刷,填充圆
CBrush brush(circle[0].brushcolor);
memDC.SelectObject(&brush);
//绘制圆
memDC.Ellipse(circle[0].x-circle[0].r,circle[0].y-circle[0].r,circle[0].x+circle[0].r,circle[0].y+circle[0].r);
pDC->BitBlt(0,0,Rect.right,Rect.bottom,&memDC,0,0,SRCCOPY);
brush.DeleteObject();
memDC.DeleteDC();