Why do wxwidgets freely draw circles or rounded polygons?

For example, if I draw this circle

Circle

clearly inaccurate and ugly. Is there a way to adjust the sensitivity of a draw?

edit:

I can generalize to:

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
+3
source share
1 answer

You can use wx.GCDC, because it supports the smoothed image

Try the following:

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

+6
source

All Articles