Skip to content
Search

WxBitmap

lastmod 2018-08-17created 2014-11-093 edits

This class encapsulates the concept of a platform-dependent bitmap, either monochrome or colour or colour with alpha channel support.

Load PNG

No image handler for type 15 defined

In this case, check in the wx/setup.h file that PNG and the like are enabled properly.

#define wxUSE_IMAGE 1
// ...
#define wxUSE_LIBPNG 1

If the error message still appears, initialize with wxInitAllImageHandlers() as shown below.

::wxInitAllImageHandlers();
wxBitmap png("myfile.png", wxBITMAP_TYPE_PNG);

to wxImage

wxImage image = bitmap.ConvertToImage();

See also

Favorite site