]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/rgncmn.cpp
Changed WidthDefault() and HeightDefault() to use 400,250. If there
[wxWidgets.git] / src / common / rgncmn.cpp
index 0cf6f5ae06a6c1ff65af474ae060534cdd5292a2..581ecbf68eb209445f2a25e8134d3a8072a85a0d 100644 (file)
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "rgncmn.h"
 #endif
 
@@ -23,7 +23,9 @@
 
 #include "wx/region.h"
 #include "wx/bitmap.h"
+#if wxUSE_IMAGE
 #include "wx/image.h"
+#endif
 #include "wx/dcmemory.h"
 
 
@@ -37,10 +39,10 @@ wxBitmap wxRegion::ConvertToBitmap() const
     wxBitmap bmp(box.GetRight(), box.GetBottom());
     wxMemoryDC dc;
     dc.SelectObject(bmp);
-    dc.SetBackground(*wxWHITE_BRUSH);
+    dc.SetBackground(*wxBLACK_BRUSH);
     dc.Clear();
     dc.SetClippingRegion(*this);
-    dc.SetBackground(*wxBLACK_BRUSH);
+    dc.SetBackground(*wxWHITE_BRUSH);
     dc.Clear();
     dc.SelectObject(wxNullBitmap);
     return bmp;
@@ -48,10 +50,17 @@ wxBitmap wxRegion::ConvertToBitmap() const
 
 //---------------------------------------------------------------------------
 
+#if wxUSE_IMAGE
 bool wxRegion::Union(const wxBitmap& bmp,
                      const wxColour& transColour,
                      int   tolerance)
+#else
+bool wxRegion::Union(const wxBitmap& WXUNUSED(bmp),
+                     const wxColour& WXUNUSED(transColour),
+                     int   WXUNUSED(tolerance))
+#endif
 {
+#if wxUSE_IMAGE
     unsigned char loR, loG, loB;
     unsigned char hiR, hiG, hiB;
 
@@ -113,7 +122,11 @@ bool wxRegion::Union(const wxBitmap& bmp,
         }
     }
 
-    return TRUE;
+    return true;
+#else
+    // No wxImage support
+    return false;
+#endif
 }
 
 //---------------------------------------------------------------------------