【问题标题】:Why wxwidgets draw loosely the circles or rounded polygons?为什么 wxwidgets 会松散地绘制圆形或圆形多边形?
【发布时间】:2014-03-11 20:22:35
【问题描述】:

例如,如果我画这个圆

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

编辑:

我可以总结为:

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

【问题讨论】:

  • 如果您可以提供一些您用来生成此代码的示例,我们可能会提出更好的建议。
  • 它是一个简单的代码......

标签: wxpython wxwidgets


【解决方案1】:

您可以使用 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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-11
    相关资源
    最近更新 更多