How do you load an image in wxWidgets

Hello readers, I am learning how to load an image, here is the code:
// Load an image
	wxImage image(wxT("image.bmp"), wxBITMAP_TYPE_PNG);
	// Convert it to a bitmap
	wxBitmap bitmap(image);

it compiles perfectly but when I run it it comes up with:
../../src/msw/cpp(802): assert "image.Ok()" failed in 
CreateFromImage(): invalid image
Do you want to stop this program? You can also choose [Cancel] to suppress further warnings


I clicked cancel and it came up with this:
No image handler for type15 defined


I have also tried JPEG images and PNG images but it came up with the same thing.
Please can someone help?
Last edited on
iirc you have to call wxInitAllImageHandlers at the start of your program.

http://docs.wxwidgets.org/2.8/wx_appinifunctions.html#wxinitallimagehandlers
Topic archived. No new replies allowed.