Opaque splash screen

Hi,
I'm trying to make a splash screen that is somewhat opaque. Here is my
code snippet for the splash screen class:

class MySplashScreen(wx.SplashScreen):
    def __init__(self,path):
        bmp = wx.Bitmap(path)
        img = bmp.ConvertToImage()
        img.InitAlpha()
        for y in range(img.GetHeight()):
            for x in range(img.GetWidth()):
                img.SetAlpha(x,y,255)
        img.ConvertAlphaToMask(220)
        bmp = img.ConvertToBitmap()
        wx.SplashScreen.__init__(self, bmp,
                                 wx.SPLASH_CENTRE_ON_SCREEN |
wx.SPLASH_TIMEOUT,
                                 5000, None, -1)
        self.Bind(wx.EVT_CLOSE, self.OnClose)
        self.fc = wx.FutureCall(2000, self.ShowMain)

    def OnClose(self, evt):
        evt.Skip()
        self.Hide()
        if self.fc.IsRunning():
            self.fc.Stop()
            self.ShowMain()

The image/png that I'm trying to use doesn't have an alpha channel,
thats why I tried to set the alpha channel for it, but I don't know if
it is correct. Any ideas what I'm doing wrong? or if it was possible
or not?
Thanks for any help

    def ShowMain(self):
        if self.fc.IsRunning():
            self.Raise()

If all you want is a uniform level of transparency for the whole window then you can just call the splash screen's SetTransparent method (inherited from wx.Frame.)

···

On 12/11/09 1:18 PM, astan wrote:

The image/png that I'm trying to use doesn't have an alpha channel,
thats why I tried to set the alpha channel for it, but I don't know if
it is correct. Any ideas what I'm doing wrong? or if it was possible
or not?

--
Robin Dunn
Software Craftsman

Thanks! This also worked. I didn't know I could do that.

···

On Dec 12, 10:12 am, Robin Dunn <ro...@alldunn.com> wrote:

On 12/11/09 1:18 PM, astan wrote:

> The image/png that I'm trying to use doesn't have an alpha channel,
> thats why I tried to set the alpha channel for it, but I don't know if
> it is correct. Any ideas what I'm doing wrong? or if it was possible
> or not?

If all you want is a uniform level of transparency for the whole window
then you can just call the splash screen's SetTransparent method
(inherited from wx.Frame.)

--
Robin Dunn
Software Craftsmanhttp://wxPython.org