Skip to content

WxBitmap

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

이 경우 wx/setup.h파일에서 정상적으로 PNG등을 사용하는지 확인해야 한다.

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

그래도 에러 메시지가 출력된다면 아래와 같이 wxInitAllImageHandlers()를 사용하여 초기화 해야 한다.

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

to wxImage

wxImage image = bitmap.ConvertToImage();

See also

Favorite site