import wx
class Example(wx.Frame):
    def __init__(self, parent):
        super(Example, self).__init__( parent, -1, 'ShapeWindows', style = wx.FRAME_SHAPED)    
        self.InitUI()
        self.Centre()
        self.Show(True)    

    def InitUI(self):
	self.Bind(wx.EVT_RIGHT_UP, self.OnExit)
        self.Bind(wx.EVT_PAINT, self.OnPaint)
	self.bmp = wx.Bitmap('C:/Users/Admin/Desktop/test.png')
        w, h = self.bmp.GetWidth(), self.bmp.GetHeight()
        self.SetClientSize( (w, h) )
        
        if wx.Platform == "__WXGTK__":
            # wxGTK requires that the window be created before you can
            # set its shape, so delay the call to SetWindowShape until
            # this event.
            self.Bind(wx.EVT_WINDOW_CREATE, self.SetWindowShape)
        else:
            # On wxMSW and wxMac the window has already been created, so go for it.
            self.SetWindowShape()
            
        dc = wx.ClientDC(self)
        dc.DrawBitmap(self.bmp, 0,0, True)

    def SetWindowShape(self, *evt):
        # Use the bitmap's mask to determine the region
        r = wx.RegionFromBitmap(self.bmp)
        self.hasShape = self.SetShape(r)    

    def OnExit(self, event):
        self.Close()

    def OnPaint(self, evt):
        dc = wx.PaintDC(self)
        dc.DrawBitmap(self.bmp, 0,0, True)

if __name__ == '__main__':
    app = wx.App(False)
    Example(None)
    app.MainLoop()