git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28811
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
-bool wxBitmap::CreateFromImage( const wxImage& image, int depth )
+bool wxBitmap::CreateFromImage( const wxImage& img, int depth )
- wxCHECK_MSG( image.Ok(), FALSE, wxT("invalid image") )
+ wxCHECK_MSG( img.Ok(), FALSE, wxT("invalid image") )
wxCHECK_MSG( depth == -1 || depth == 1, FALSE, wxT("invalid bitmap depth") )
wxCHECK_MSG( depth == -1 || depth == 1, FALSE, wxT("invalid bitmap depth") )
+ // NB: wxGTK doesn't yet support alpha channel in bitmaps. The best we can
+ // do is to convert alpha channel to mask, if it is present:
+ wxImage image(img);
+ image.ConvertAlphaToMask();
+
int width = image.GetWidth();
int height = image.GetHeight();
int width = image.GetWidth();
int height = image.GetHeight();
-bool wxBitmap::CreateFromImage( const wxImage& image, int depth )
+bool wxBitmap::CreateFromImage( const wxImage& img, int depth )
- wxCHECK_MSG( image.Ok(), FALSE, wxT("invalid image") )
+ wxCHECK_MSG( img.Ok(), FALSE, wxT("invalid image") )
wxCHECK_MSG( depth == -1 || depth == 1, FALSE, wxT("invalid bitmap depth") )
wxCHECK_MSG( depth == -1 || depth == 1, FALSE, wxT("invalid bitmap depth") )
+ // NB: wxGTK doesn't yet support alpha channel in bitmaps. The best we can
+ // do is to convert alpha channel to mask, if it is present:
+ wxImage image(img);
+ image.ConvertAlphaToMask();
+
int width = image.GetWidth();
int height = image.GetHeight();
int width = image.GetWidth();
int height = image.GetHeight();