Depending on platform the wx.MemoryDC may or may not have any clue about
the bitmap's alpha channel (for example, on Windows the wx.DC classes
are all based on pre-alpha APIs,) so the behavior is pretty much
undefined. However if you use the memory DC as the target of a
wx.GraphicsContext then you can get it to honor the bitmap's alpha
channel and blend properly.
>
> So the goal is to get a transparent background, and when I put the
> wx.bitmap (using wx.StaticBitmap) on a panel with a GradientFill
> background the outline of the bitmap doesn't show. Only the stuff that
> has been drawn on it after setting the background to transparent.
This is actually a different problem. The issue here is that since a
wx.StaticBitmap is an independent widget then it has its own window
background, and when it draws the bitmap on itself then that background
is still there, and the parent's background is clipped. (In this
specific case it is mainly just Windows that behaves this way, Mac and
GTK do deal pretty well with transparencies in the static widget types.)
If you want the bitmap to appear to be blended with the parent then I
would go ahead and draw it directly on the parent and don't use the
wx.StaticBitmap.
--
Robin Dunn
Software Craftsman
http://wxPython.org