]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/rgncmn.cpp
wxFileName::Normalize(wxPATH_NORM_ENV_VARS) now works
[wxWidgets.git] / src / common / rgncmn.cpp
index c794b59ab9134843232cb49884bb34ed8360e687..41b273e76c123fcafd185384c16654c831e0f6c9 100644 (file)
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "rgncmn.h"
 #endif
 
@@ -23,6 +23,9 @@
 
 #include "wx/region.h"
 #include "wx/bitmap.h"
+#if wxUSE_IMAGE
+#include "wx/image.h"
+#endif
 #include "wx/dcmemory.h"
 
 
@@ -36,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;
@@ -51,6 +54,7 @@ bool wxRegion::Union(const wxBitmap& bmp,
                      const wxColour& transColour,
                      int   tolerance)
 {
+#if wxUSE_IMAGE
     unsigned char loR, loG, loB;
     unsigned char hiR, hiG, hiB;
 
@@ -113,6 +117,10 @@ bool wxRegion::Union(const wxBitmap& bmp,
     }
 
     return TRUE;
+#else
+    // No wxImage support
+    return FALSE;
+#endif
 }
 
 //---------------------------------------------------------------------------