I am a beginner programmer who is moving on from the basics of python to wxPython. I have the book wxPython in Action and am using it as a reference while I make GUI programs for fun (still haven't sat down and read through the book, will someday). I am figuring everything out fine EXCEPT for loading images. I can't for the life of me figure this out. I keep getting this error:
Traceback (most recent call last):
File "C:\Python26\testimage.py", line 14, in <module>
frame = Frame()
File "C:\Python26\testimage.py", line 10, in __init__
sb1 = wx.StaticBitmap(p, -1, wx.BitmapFromImage(img1))
File "C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\_gdi.py", line 823, in BitmapFromImage
val = _gdi_.new_BitmapFromImage(*args, **kwargs)
PyAssertionError: C++ assertion "image.Ok()" failed at ..\..\src\msw\bitmap.cpp(802) in wxBitmap::CreateFromImage(): invalid image
...no matter what I do. I am so confused, does the image have to be in a specific place for me to load it? Am I using bad images? I tried a simple example out of the book, the image is on my desktop, but it keeps saying invalid image, even when I try new images. Any ideas on what I'm doing wrong?