|
怎样吧下面一段代码实现双缓冲
void Bckgnd(HDC h_destDC)
{
CWnd * pParent;
CRect wndRect;
int width;
int height;
pParent = this->GetParent();
CDC *pDC = pParent->GetWindowDC();
GetWindowRect(&wndRect);
pParent->ScreenToClient(&wndRect);
width = wndRect.Width();
height = wndRect.Height();
HDC hDC = ::CreateCompatibleDC(NULL);
::SelectObject(hDC, m_hBmpBkgnd);
::BitBlt(h_destDC, 0, 0, width, height, hDC, wndRect.left, wndRect.top, SRCCOPY);
::DeleteDC(hDC);
}
|
|