你好家伙我有一个双缓冲的问题。 我不知道为什么,但我的文字没有绘制(没有双缓冲文本就是绘图)。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