Discussion:
Huh??? No image handler for type 15 defined?
Pamela Goetz
21 years ago
Permalink
I am trying to load a small PNG image file as follows:

wxImage image;
image.LoadFile (wxT("bitmaps/new.png"), wxBITMAP_TYPE_PNG);

But instead I get:
"Warning: No image handler for type 15 defined."

This is on Windows (wxMSW). I compiled the library with PNG, ZLIB,
TIFF, JPEG, etc. support (or so I believe?)

How is it possible that a handler for PNG cannot be found?

Thanks,
Pam

=====
WX : 2.4.2
OS : Windows 2000
COMPILER: VC++ 6 (IDE)

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

---------------------------------------------------------------------
Please read http://www.wxwindows.org/mlhowto.htm before posting.

To unsubscribe, e-mail: wx-users-***@lists.wxwindows.org
For additional commands, e-mail: wx-users-***@lists.wxwindows.org
David Elliott
21 years ago
Permalink
Post by Pamela Goetz
wxImage image;
image.LoadFile (wxT("bitmaps/new.png"), wxBITMAP_TYPE_PNG);
"Warning: No image handler for type 15 defined."
This is on Windows (wxMSW). I compiled the library with PNG, ZLIB,
TIFF, JPEG, etc. support (or so I believe?)
How is it possible that a handler for PNG cannot be found?
Not all image handlers are linked in by default. Did you add the image
handler and/or initialize all handlers? (See the wxImage(Handler)
documentation)

-Dave


---------------------------------------------------------------------
Please read http://www.wxwindows.org/mlhowto.htm before posting.

To unsubscribe, e-mail: wx-users-***@lists.wxwindows.org
For additional commands, e-mail: wx-users-***@lists.wxwindows.org
Robin Dunn
21 years ago
Permalink
Post by Pamela Goetz
wxImage image;
image.LoadFile (wxT("bitmaps/new.png"), wxBITMAP_TYPE_PNG);
"Warning: No image handler for type 15 defined."
This is on Windows (wxMSW). I compiled the library with PNG, ZLIB,
TIFF, JPEG, etc. support (or so I believe?)
How is it possible that a handler for PNG cannot be found?
Only BMP and XMP image handlers are loaded by default. You can either
add thepng handler explicitly or load them all using
wxInitAllImageHandlers().
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!



---------------------------------------------------------------------
Please read http://www.wxwindows.org/mlhowto.htm before posting.

To unsubscribe, e-mail: wx-users-***@lists.wxwindows.org
For additional commands, e-mail: wx-users-***@lists.wxwindows.org
John Labenski
21 years ago
Permalink
Post by Pamela Goetz
wxImage image;
image.LoadFile (wxT("bitmaps/new.png"), wxBITMAP_TYPE_PNG);
"Warning: No image handler for type 15 defined."
This is on Windows (wxMSW). I compiled the library with PNG, ZLIB,
TIFF, JPEG, etc. support (or so I believe?)
How is it possible that a handler for PNG cannot be found?
See wxInitAllImageHandlers...

-John Labenski


---------------------------------------------------------------------
Please read http://www.wxwindows.org/mlhowto.htm before posting.

To unsubscribe, e-mail: wx-users-***@lists.wxwindows.org
For additional commands, e-mail: wx-users-***@lists.wxwindows.org
Pamela Goetz
21 years ago
Permalink
Post by Pamela Goetz
wxImage image;
image.LoadFile (wxT("bitmaps/new.png"), wxBITMAP_TYPE_PNG);
"Warning: No image handler for type 15 defined."
This is on Windows (wxMSW). I compiled the library with PNG, ZLIB,
TIFF, JPEG, etc. support (or so I believe?)
How is it possible that a handler for PNG cannot be found?
Thank you Dave, Robin & John. You were right on the money! I wasn't
aware of the need to explicitly initialize handlers (except for BMP and
XPM). Now I know... All I had to do was placing in MyApp::OnInit() a
line like this:

wxImage::AddHandler( new wxPNGHandler );

Works like a charm (and answers the question in my previous posting
about how to use PNG only for toolbar bitmaps). :-)

Thanks!
Pam




=====
WX : 2.4.2
OS : Windows 2000
COMPILER: VC++ 6 (IDE)

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

---------------------------------------------------------------------
Please read http://www.wxwindows.org/mlhowto.htm before posting.

To unsubscribe, e-mail: wx-users-***@lists.wxwindows.org
For additional commands, e-mail: wx-users-***@lists.wxwindows.org
Continue reading on narkive:
Loading...