Reputation: 3177
Sometimes it is required to create a dummy bitmap for test purposes. To make the bitmap discernable (e. g. a red one and green one), I am searching for a way to create a wx.Bitmap
with as few lines of code as possible.
What I did come up with sofar:
size_h_w = 64
bmp1 = wx.EmptyBitmapRGBA(size_h_w, size_h_w, red=255, alpha=1)
bmp2 = wx.EmptyBitmapRGBA(size_h_w, size_h_w, green=255, alpha=0)
However, the only thing I get with this is a black and transparent bitmap. How to make the color argument work?
Target is from wxPython 2.9
onward (wxMSW
).
Upvotes: 1
Views: 1125
Reputation: 6306
Try using alpha=255
(or wx.ALPHA_OPAQUE
). That is the alpha level for fully opaque. Zero is fully transparent, and one is almost fully transparent.
Upvotes: 3