[wxPython] wxImage Problems

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[wxPython] wxImage Problems

Joseph Martin-3
Hello,
        First off I wanted to thank Robin Dunn for the excellent work
he has done with wxPython and for the help he gave me last time I had
a problem. This problem relates to loading a PNG image with the
wxImage class. I have included my python file so you can see any
possible code interactions that might exist. The image does exist and
is readable by the script. When I run the script I get a nice GTK
dialog box telling me that "No image handler for type 15 defined."
The annoying thing is that the demo code included with wxPython loads
the PNG image flawlessly. (In point of fact I am using the same
image.)

I appreciate any and all help.

Thanks,
Joseph

--
[hidden email]

All opinions expressed are my own and not necessarily those of
my employer unless otherwise noted.

album.py (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] wxImage Problems

Robin Dunn
> is readable by the script. When I run the script I get a nice GTK
> dialog box telling me that "No image handler for type 15 defined."
> The annoying thing is that the demo code included with wxPython loads
> the PNG image flawlessly. (In point of fact I am using the same
> image.)
>

You need to call wxImage_AddHandler(wxPNGHandler()) sometime before you try
to use the image.  wxWindows has the concept of image handlers that can be
loaded only for programs that need them to save memory resources.  The next
version of wxPython will have wxInitAllImageHandlers() to load them all for
you.

--
Robin Dunn
Software Craftsman
[hidden email]
http://AllDunn.com/robin/
http://AllDunn.com/wxPython/  Check it out!



_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users