import wx
class DrawPanel(wx.Frame):
def __init__(self):
wx.Frame.__init__(self,None,title="Draw",size=(150,150))
self.SetTransparent(0)
self.Bind(wx.EVT_PAINT, self.OnPaint)
def OnPaint(self, event=None):
dc = wx.PaintDC(self)
dc.SetPen(wx.Pen(wx.BLACK, 5))
# Draw a line
dc.DrawLine(0, 0, 150, 150)
app = wx.App()
frame = DrawPanel()
frame.Show(True)
app.MainLoop()
现在框架和线条都是不可见的。
请告诉我如何使框架完全透明,而线条可见?