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