[wxPython-users] Setting a transparent region on a bitmap

Christopher Barker Chris.Barker at noaa.gov
Wed Jan 2 11:50:44 PST 2008


David Poundall wrote:
> I am trying to get to grips with masking a bitmap and I am have a 
> problem.  Based on AG’s code I am running this in a frame …
> 
>  
> 
>         mask = wx.Mask(self.bmp, wx.WHITE)
>         self.bmp.SetMask(mask)       
>         self.reg = wx.RegionFromBitmap(self.bmp)
>         self.SetShape(self.reg)
>         self.Show()

Do try to make a complete, running sample, so we can try it out and know 
all of what you are trying to do, but:

I don't think you want self.SetShape(self.reg) -- that sets the "Shape" 
of the Window, so it will only draw within that shape. If you just set 
the mast and Show() you should be done, but it's hard to know without 
knowing what your Paint handler is doing.


-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov




More information about the wxpython-users mailing list