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

Christopher Barker Chris.Barker at noaa.gov
Wed Jan 2 14:47:14 PST 2008



David Poundall wrote:
> Sorry Chris, full code as follows....

But not quite a running app! (you might want to enclose your bitmap too, 
if it's not too big.

I'm also not quite sure what you are trying to do. It looks like  you 
want a Frame shaped as the "real" part of your bitmap. You've provided 
the shape for the Frame, but not actualy drawn anything on it --  you 
need to draw the bitmap somewhere, like in a Paint handler for instance:

> class SplashScreen(wx.Frame):

...

>         pos=wx.DefaultPosition
>         size=wx.DefaultSize
>         style= wx.FRAME_SHAPED | wx.STAY_ON_TOP | wx.FRAME_NO_TASKBAR
           # just leave size and pos out if you want to use the 
defaults:
          wx.Frame.__init__(self, None, style=style)
...
           self.bind(wx.EVT_PAINT), self.OnPaint)
...
         def OnPaint(self, event):
             dc = wx.PaintDC(self)
             dc.DrawBitmap(self.bmp, x, y, True)


Does that get you closer?



-- 
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