我正在寻找添加双缓冲的绘图函数,就像这样。
dc = wx.PaintDC(self)
gc = wx.GraphicsContext.Create(dc)
#draw GraphicsPaths to the gc我尝试先绘制一个MemoryDC,然后再将其返回到PaintDC:
dc = wx.MemoryDC()
dc.SelectObject(wx.NullBitmap)
gc = wx.GraphicsContext.Create(dc)
#draw GraphicsPaths to the gc
dc2=wx.PaintDC(self)
dc2.Blit(0,0,640,480,dc,0,0)然而,这只给了我一个空白屏幕。我是不是误解了MemoryDC的工作原理?
发布于 2010-03-16 10:28:49
您需要创建一个位图,而不是使用wx.NullBitmap。
bitmap = wx.EmptyBitmap(w, h)
dc = wx.MemoryDC(bitmap)https://stackoverflow.com/questions/2451610
复制相似问题