## page was renamed from How to draw an elliptic arc (Phoenix) = How to create an elliptic arc (Phoenix) = '''Keywords :''' EllipticArc, Drawing, PaintDC, GCDC. <<TableOfContents>> -------- = Demonstrating : = __'''''Tested''' py3.x, wx4.x and Win10. ''__ Are you ready to use some samples ? ;) Test, modify, correct, complete, improve and share your discoveries ! (!) -------- == First example == {{attachment:img_sample_one.png}} {{{#!python # sample_one.py import wx # class MyPanel # class MyFrame # class MyApp #--------------------------------------------------------------------------- class MyPanel(wx.Panel): def __init__(self, *args, **kwargs): wx.Panel.__init__(self, *args, **kwargs) self.Bind(wx.EVT_PAINT, self.OnPaint) #----------------------------------------------------------------------- def OnPaint(self, event): """ ... """ pdc = wx.PaintDC(self) gc = wx.GCDC(pdc) gc.Clear() pen = wx.Pen("black", 2, wx.SOLID) pen.SetCap(wx.CAP_BUTT) gc.SetPen(pen) gc.SetBrush(wx.RED_BRUSH) x = 100 y = 30 w = 50 h = 50 for radius in [0, 90, 180, 270, -90, -180, -270]: # x, y , width, height, start, end gc.DrawEllipticArc(x, y, w, h, 0, radius) gc.DrawText(str(radius), int(x+w+10), int(y+h/2)) y+=100 #--------------------------------------------------------------------------- class MyFrame(wx.Frame): def __init__(self, *args, **kwargs): wx.Frame.__init__(self, *args, **kwargs) #------------ frameicon = wx.Icon("icon_wxWidgets.ico") self.SetIcon(frameicon) #------------ self.Panel = MyPanel(self) #--------------------------------------------------------------------------- class MyApp(wx.App): """ ... """ def OnInit(self): #------------ frame = MyFrame(None, title="Sample_one - A", size=(270, 750)) self.SetTopWindow(frame) frame.Show(True) return True #--------------------------------------------------------------------------- def main(): app = MyApp(False) app.MainLoop() #--------------------------------------------------------------------------- if __name__ == "__main__" : main() }}} -------- = Download source = [[attachment:source.zip]] -------- = Additional Information = '''Link :''' http://zetcode.com/wxpython/gdi/ - - - - - https://wiki.wxpython.org/TitleIndex https://docs.wxpython.org/ -------- = Thanks to = Chris Barker (sample_one.py coding), the wxPython community... -------- = About this page = Date(d/m/y) Person (bot) Comments : 14/12/19 - Ecco (Created page for wxPython Phoenix). -------- = Comments = - blah, blah, blah....