How about wx.NullBitmap?
> currently I just use a 16x16 blank PNG that
> I made, but for portability reasons I'd like to do this internally if
> possible.
Although here wx.NullBitmap is a better approach in this case, for the
future you might want to know that you can use img2py to make any
image you want into pure Python code and so include images without
having to include the image files.
Che
wx.NullBitmap is not an empty bitmap, it is an invalid one used for
things like what we would normally use None for in Python.
>>> import wx
>>> wx.NullBitmap.Ok()
False
>>> wx.EmptyBitmap(16,16).Ok()
True
--
Robin Dunn
Software Craftsman
http://wxPython.org
It happens to be that way on Windows because of the way the native API
works, but be aware that on other platforms the RGB data for a bitmap
created this way will just use whatever happens to be in that memory at
the time, IOW, random junk. So you should not depend on the initial
content being black and if you want it to be a certain color you can
initialize it yourself like this:
bmp = wx.EmptyBitmap(w, h)
dc = wx.MemoryDC(bmp)
dc.SetBackground(wx.Brush("black")) # or some other color
dc.Clear()
del dc
If you also want the bitmap to be transparent (which you probably do in
this case) then you can set the mask using the color that the bitmap was
Clear()ed to:
bmp.SetMaskColour('black')