Sorry Chris, full code as follows....
class SplashScreen(wx.Frame):
""" Splash screen configured so that it destroys once the main
Console frame has instigated or if the timer times out."""
def __init__(self, bmp, timeout=10000):
self.bmp = bmp
pos=wx.DefaultPosition
size=wx.DefaultSize
style= wx.FRAME_SHAPED | wx.STAY_ON_TOP | wx.FRAME_NO_TASKBAR
wx.Frame.__init__(self, None, -1, "", pos, size, style)
mask = wx.Mask(self.bmp, wx.WHITE)
self.bmp.SetMask(mask)
self.reg = wx.RegionFromBitmap(self.bmp)
self.SetShape(self.reg)
#Starts The Timer. Once Expired, AdvancedSplash Is Destroyed
self._splashtimer = wx.PyTimer(self.Close)
self._splashtimer.Start(timeout)
# Set The AdvancedSplash Size To The Bitmap Size
w = self.bmp.GetWidth()
h = self.bmp.GetHeight()
self.SetSize((w, h))
# Bind the close event and display the screen
self.Bind(wx.EVT_CLOSE, self.CloseTest)
self.CenterOnScreen()
self.Show()
def CloseTest(self,event):
""" Closing
"""
app.frConsole.Show()
event.Skip()
Note - Since the original post I have upgraded to Python 2.5 from 2.4.
can't get the full bitmap to display at all now. Probably a red herring but
I mention it just in case.
I will try other forms of bitmap as per Andrea's class notes. Will report
back.
- Thanks
···
-----Original Message-----
From: Christopher Barker [mailto:Chris.Barker@noaa.gov]
Sent: 02 January 2008 19:51
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] Setting a transparent region on a bitmapDavid 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.
OceanographerEmergency 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 receptionChris.Barker@noaa.gov
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.orgNo virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.17.13/1206 - Release Date:
01/01/2008 12:09
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.17.13/1206 - Release Date: 01/01/2008
12:09