13.07.2015 Views

The wxPython tutorial

The wxPython tutorial

The wxPython tutorial

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>The</strong> Graphics Device Interfacehttp://www.zetcode.com/wxpython/gdi/pen.SetCap(wx.CAP_ROUND)dc.SetPen(pen)dc.DrawLine(30, 230, 150, 230)pen2 = wx.Pen('#4c4c4c', 1, wx.SOLID)dc.SetPen(pen2)dc.DrawLine(30, 130, 30, 250)dc.DrawLine(150, 130, 150, 250)dc.DrawLine(155, 130, 155, 250)app = wx.App()JoinsCaps(None, -1, 'Joins and Caps')app.MainLoop()pen = wx.Pen('#4c4c4c', 10, wx.SOLID)In order to see the various Join and Cap styles, we need to setthe pen width to be greater than 1.dc.DrawLine(150, 130, 150, 250)dc.DrawLine(155, 130, 155, 250)Notice the two enclosing vertical lines. <strong>The</strong> distance betweenthem is 5px. It is exactly the half of the current pen width.Figure: Joins and CapsGradientsIn computer graphics, gradient is a smooth blending of shades12 de 44 27/04/2008 1:08

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!