Using wxPython 2.8.9.1 on Linux (Debian).
I can't draw on a transparently initialised bitmap. The following code :
···
#--------------------------------------------
import wx
app = wx.PySimpleApp()
bitmap = wx.EmptyBitmapRGBA(100, 100, 0, 0, 0, 0)
dc = wx.MemoryDC()
dc.SelectObject(bitmap)
dc.SetBrush(wx.Brush("Red"))
dc.DrawRectangle(10, 10, 20, 20)
image = bitmap.ConvertToImage()
image.SaveFile('test_out.png', wx.BITMAP_TYPE_PNG)
#--------------------------------------------
produces "test_out.png" which is totally transparent (no red square).
The following code :
#--------------------------------------------
import wx
app = wx.PySimpleApp()
bitmap = wx.EmptyBitmapRGBA(100, 100, 0, 0, 0, 255)
dc = wx.MemoryDC()
dc.SelectObject(bitmap)
dc.SetBrush(wx.Brush("Red"))
dc.DrawRectangle(10, 10, 20, 20)
image = bitmap.ConvertToImage()
image.SaveFile('test_out.png', wx.BITMAP_TYPE_PNG)
#--------------------------------------------
produces "test_out.png" which is black opaque with a little red square.
It looks like the drawing primitives don't affect the alpha layer.
Shouldn't they ?
David.