Put a wxRegion test into the erase sample.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14256 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -39,7 +39,7 @@
|
|||||||
// resources
|
// resources
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// the application icon
|
// the application icon
|
||||||
#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__)
|
#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) || defined(__WXX11__)
|
||||||
#include "mondrian.xpm"
|
#include "mondrian.xpm"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -181,8 +181,13 @@ void MyCanvas::OnPaint( wxPaintEvent &event )
|
|||||||
wxPaintDC dc(this);
|
wxPaintDC dc(this);
|
||||||
PrepareDC( dc );
|
PrepareDC( dc );
|
||||||
|
|
||||||
|
wxRegion region( 110, 110, 80, 80 );
|
||||||
|
wxRegion hole( 130, 130, 40, 1 );
|
||||||
|
region.Intersect( hole );
|
||||||
|
dc.SetClippingRegion( region );
|
||||||
|
|
||||||
dc.SetBrush( *wxRED_BRUSH );
|
dc.SetBrush( *wxRED_BRUSH );
|
||||||
dc.DrawRectangle( 100, 100, 300, 500 );
|
dc.DrawRectangle( 100, 100, 200, 200 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyCanvas::OnEraseBackground( wxEraseEvent &event )
|
void MyCanvas::OnEraseBackground( wxEraseEvent &event )
|
||||||
|
Reference in New Issue
Block a user