wx.DCClipper is a helper class for setting a clipping region on a wx.DC during its lifetime.
An object of wx.DCClipper class is typically created on the stack so that it is automatically destroyed when the object goes out of scope. A typical usage example:
def MyFunction(dc):
clip = wx.DCClipper(dc, rect)
# ... drawing functions here are affected by clipping rect ...
def OtherFunction():
dc = wx.DC()
MyFunction(dc)
# ... drawing functions here are not affected by clipping rect ...
Note
Since 3.1.1 wx.DCClipper restores the previously active clipping region when it is destroyed. Previously it reset clipping on the associated wx.DC and this has to be taken into account explicitly in previous wxWidgets versions.
See also
wx.DC.SetClippingRegion
, wx.DCFontChanger, wx.DCTextColourChanger, wx.DCPenChanger, wx.DCBrushChanger
Sets the clipping region to the specified region/coordinates. |
|
wx.
DCClipper
(object)¶Possible constructors:
DCClipper(dc, region)
DCClipper(dc, rect)
DCClipper(dc, x, y, w, h)
DCClipper is a helper class for setting a clipping region on a DC during its lifetime.
__init__
(self, *args, **kw)¶Sets the clipping region to the specified region/coordinates.
The clipping region is automatically unset when this object is destroyed.
__init__ (self, dc, region)
__init__ (self, dc, rect)
__init__ (self, dc, x, y, w, h)
dc (wx.DC) –
x (int) –
y (int) –
w (int) –
h (int) –
__enter__
(self)¶__exit__
(self, exc_type, exc_val, exc_tb)¶