From a7cfe08aff22afc81e29fc93018cff111f59d129 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Thu, 24 Aug 2006 04:41:45 +0000 Subject: [PATCH] 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 --- src/gtk/bitmap.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gtk/bitmap.cpp b/src/gtk/bitmap.cpp index c5ebe0fabd..d6d039b893 100644 --- a/src/gtk/bitmap.cpp +++ b/src/gtk/bitmap.cpp @@ -109,8 +109,11 @@ bool wxMask::Create( const wxBitmap& bitmap, { GdkImage* image = gdk_drawable_get_image(bitmap.GetPixmap(), 0, 0, w, h); GdkColormap* colormap = gdk_image_get_colormap(image); - guint32 mask_pixel = 1; - if (colormap != NULL) + guint32 mask_pixel; + 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); c.CalcPixel(colormap); -- 2.45.2