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:
Paul Cornett
2006-08-24 04:41:45 +00:00
parent f9562c6b2d
commit a7cfe08aff

View File

@@ -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);