allow white as mask color when creating mask from mono bitmap
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40783 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -109,8 +109,11 @@ bool wxMask::Create( const wxBitmap& bitmap,
|
|||||||
{
|
{
|
||||||
GdkImage* image = gdk_drawable_get_image(bitmap.GetPixmap(), 0, 0, w, h);
|
GdkImage* image = gdk_drawable_get_image(bitmap.GetPixmap(), 0, 0, w, h);
|
||||||
GdkColormap* colormap = gdk_image_get_colormap(image);
|
GdkColormap* colormap = gdk_image_get_colormap(image);
|
||||||
guint32 mask_pixel = 1;
|
guint32 mask_pixel;
|
||||||
if (colormap != NULL)
|
if (colormap == NULL)
|
||||||
|
// mono bitmap, white is pixel value 0
|
||||||
|
mask_pixel = guint32(colour.Red() != 255 || colour.Green() != 255 || colour.Blue() != 255);
|
||||||
|
else
|
||||||
{
|
{
|
||||||
wxColor c(colour);
|
wxColor c(colour);
|
||||||
c.CalcPixel(colormap);
|
c.CalcPixel(colormap);
|
||||||
|
Reference in New Issue
Block a user