On 12/15/09 7:39 AM, Paul Sijben wrote:
> I have some code that will generate a transparent bitmap with in it a
> combination of two other bitmaps (see code below). This works great on
> both linux and windows, however on the Mac the resulting bitmap is not
> transparent but has an ugly black background.
> Can someone please tell me what I need to change to make this work on
> the mac?
> bgbrush=wx.Brush(bg,wx.TRANSPARENT)
If there is a bug here it is with wxGTK and wxMSW because a transparent
brush is not supposed to actually draw anything. In other words, its
transparency is not due to it drawing in such a way that a mask or alpha
channel is set, but because it doesn't touch the pixels that are already
there. Apparrently if a valid colour is also set on GTK and MSW then
that is taking precedence, but on Mac the style is overriding the colour.
To fix this all you should need to do is not use the wx.TRANSPARENT
style. You'll get your transparency later when you set the mask.
--
Robin Dunn
Software Craftsman
http://wxPython.org