为什么wxwidgets会松散地绘制圆形或圆形多边形?

时间:2014-02-13 05:35:05

标签: wxpython wxwidgets

例如,如果我画这个圆圈

Circle

显然是不精确和丑陋的。有没有办法调整抽奖的灵敏度

编辑:

我可以总结一下:

self.da = wx.Panel(self, -1, size=(-1, 800))
self.da.Bind(wx.EVT_PAINT, self.paint)

self._buffer = wx.EmptyBitmap(500,500) # creating empty buffer
dc = wx.MemoryDC(self._buffer)  # to handle the buffer
dc.SetBackground( wx.Brush("White") )  # setting background
dc.DrawCircle(50,40,100)  #drawing circle


def paint(self, evt):
    dc = wx.BufferedPaintDC(self.da, self._buffer) #on paint event draw this

1 个答案:

答案 0 :(得分:7)

您可以使用wx.GCDC,因为它支持抗锯齿绘图

试试这个:

buffer = wx.EmptyBitmap(500,500) # creating empty buffer
dc = wx.MemoryDC(buffer)  # to handle the buffer
dc = wx.GCDC(dc)

dc.SetBackground( wx.Brush("White") )  # setting background
dc.DrawCircle(50,40,100)  #drawing circle
dc.DrawCircle(200,200,100)  #drawing circle

enter image description here