+
+bool wxRegionBase::Union(const wxBitmap& bmp)
+{
+ if (bmp.GetMask())
+ {
+ wxImage image = bmp.ConvertToImage();
+ wxASSERT_MSG( image.HasMask(), _T("wxBitmap::ConvertToImage doesn't preserve mask?") );
+ return DoRegionUnion(*this, image,
+ image.GetMaskRed(),
+ image.GetMaskGreen(),
+ image.GetMaskBlue(),
+ 0);
+ }
+ else
+ {
+ return Union(0, 0, bmp.GetWidth(), bmp.GetHeight());
+ }
+}
+
+bool wxRegionBase::Union(const wxBitmap& bmp,
+ const wxColour& transColour,
+ int tolerance)
+{
+ wxImage image = bmp.ConvertToImage();
+ return DoRegionUnion(*this, image,
+ transColour.Red(),
+ transColour.Green(),
+ transColour.Blue(),
+ tolerance);
+}
+
+#endif // wxUSE_IMAGE
+
+#ifdef wxHAS_REGION_COMBINE
+// ============================================================================
+// wxRegionWithCombine
+// ============================================================================
+
+// implement some wxRegionBase pure virtuals in terms of Combine()
+bool wxRegionWithCombine::DoUnionWithRect(const wxRect& rect)
+{
+ return Combine(rect, wxRGN_OR);
+}
+
+bool wxRegionWithCombine::DoUnionWithRegion(const wxRegion& region)
+{
+ return DoCombine(region, wxRGN_OR);
+}
+
+bool wxRegionWithCombine::DoIntersect(const wxRegion& region)
+{
+ return DoCombine(region, wxRGN_AND);
+}
+
+bool wxRegionWithCombine::DoSubtract(const wxRegion& region)
+{
+ return DoCombine(region, wxRGN_DIFF);
+}
+
+bool wxRegionWithCombine::DoXor(const wxRegion& region)
+{
+ return DoCombine(region, wxRGN_XOR);
+}
+
+#endif // wxHAS_REGION_COMBINE