你好傢伙我有一個雙緩衝的問題。 我不知道爲什麼,但我的文字沒有繪製(沒有雙緩衝文本就是繪圖)。C++/WinAPI GDI +雙緩衝
這裏是代碼:
m_hDC = BeginPaint(m_hWnd, &m_ps);
m_graphics = new Graphics(m_hDC);
memDC = CreateCompatibleDC(m_hDC);
pMemGraphics = new Graphics(memDC);
pMemGraphics->DrawString(L"Hello world!", -1, font, PointF(100, 100), &brush);
BitBlt(m_hDC, 0, 0, 500, 200, memDC, 0, 0, SRCCOPY);
EndPaint(m_hWnd, &m_ps);
delete(pMemGraphics);
delete(m_graphics);
的哪些錯誤?
那些'新'和'刪除'看起來非常不必要。也可以嘗試從'm_hDC'選擇'CreateCompatibleBitmap'到'memDC'。 – chris