Hello,
im trying to draw to a bitmap in memory. This bitmap is then in the PAINT Event drawn
to a Panels PaintDC. The background of the bitmap should be completly transparent.
Code Snippet:
def drawtobuffer(self):
Size = self.GetClientSize()
self.Buffer = wx.EmptyBitmapRGBA(Size.width, Size.height, 0, 0, 0, 0)
mdc = wx.MemoryDC()
mdc.SelectObject(self.Buffer)
dc = wx.GCDC(mdc)
color = wx.Colour( 35, 142, 35, 128)
dc.SetBrush(wx.Brush(color))
dc.SetPen(wx.Pen('CADET BLUE', 2))
dc.DrawRectangle(50,50,100,50)
mdc.SelectObject(wx.NullBitmap)
self.Refresh()
On Ubuntu 12.10 with wxPython 2.9.4.1 gtk2 (classic) the Bitmap is empty. Setting the alpha channel in the line
self.Buffer = wx.EmptyBitmapRGBA(Size.width, Size.height, 0, 0, 0, 128)
to 128 as shown above, the bitmap is no more empty. But the background is opaque.
On Windows7 with wxPython 2.8 everything works fine.