]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/bitmap.cpp
Default construcctor for Iterator
[wxWidgets.git] / src / gtk / bitmap.cpp
index c5ebe0fabd2a0ef9cf4a7c0fd7da2b68a6f552b8..69fe0377df873b5ad964ea898feb864f81207c03 100644 (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);
@@ -641,7 +644,6 @@ wxImage wxBitmap::ConvertToImage() const
     {
         GdkPixmap* pixmap = GetPixmap();
         GdkPixmap* pixmap_invert = NULL;
-#if 0
         if (GetDepth() == 1)
         {
             // mono bitmaps are inverted
@@ -652,7 +654,6 @@ wxImage wxBitmap::ConvertToImage() const
             g_object_unref(gc);
             pixmap = pixmap_invert;
         }
-#endif
         // create a pixbuf which shares data with the wxImage
         GdkPixbuf* pixbuf = gdk_pixbuf_new_from_data(
             data, GDK_COLORSPACE_RGB, false, 8, w, h, 3 * w, NULL, NULL);