I'm trying to set up a splashscreen for my app. I am calling a
monochrome WINDOWS bmp file and I get an error message. The error
messages are different depending on whether I comment out this line:
bmp = image.ConvertToBitmap()
I am working with PortablePython (the PYTHON 2.5 version). I am using
wxPYTHON version 2.8.8.1. The machine that I am currently using for
development is a VISTA machine but the target is an XP platform.
Here is the code of a small test program that I wrote. The code is
exactly the same as in my program and the error messages are the same:
import wx
if __name__ == '__main__':
pr = wx.PySimpleApp()
image = wx.Image("honeysuckle.bmp",wx.BITMAP_TYPE_BMP)
bmp = image.ConvertToBitmap()
wx.SplashScreen(bmp,wx.SPLASH_CENTRE_ON_SCREEN|wx.SPLASH_TIMEOUT,
15000,None,-1)
wx.Yield()
I wrote the code based on the example in 'wxPYTHON in Action' by
Rappin and Dunn.
When I leave the line mentioned above uncommented, I get this error
message:
File "splashTest01.py", line 5, in <module>
bmp = image.ConvertToBitmap()
File "E:\PortablePython1.0\lib\site-packages\wx\_core.py", line
3340, in ConvertToBitmap
wx._core.PyAssertionError: C++ assertion "image.Ok()" failed at ..\..
\src\msw\bitmap.cpp(799) in wxBitmap::CreateFromImage(): invalid image
If I comment out that line and change 'image =' to 'bmp =', I get this
error message:
Traceback (most recent call last):
File "splashTest01.py", line 6, in <module>
wx.SplashScreen(bmp,wx.SPLASH_CENTRE_ON_SCREEN|wx.SPLASH_TIMEOUT,
15000,None,-1)
File "E:\PortablePython1.0\lib\site-packages\wx\_windows.py", line
836, in __init__
TypeError: in method 'new_SplashScreen', expected argument 1 of type
'wxBitmap const &'
I would appreciate any suggestions you might have.