wxWidgets: wxDCClipper Class Reference

| Version: 3.0.5

Public Member Functions | List of all members
wxDCClipper Class Reference
Class List by Category » Graphics Device Interface (GDI)

`#include </home/Hamis/wxwidgets/wxWidgets3.0/wxWidgets3.0-3.0.5.1-2.i686/src/wxWidgets-3.0.5.1/interface/wx/dc.h>`

## Detailed Description

wxDCClipper is a helper class for setting a clipping region on a wxDC during its lifetime.

An object of wxDCClipper class is typically created on the stack so that it is automatically destroyed when the object goes out of scope. A typical usage example:

void MyFunction(wxDC& dc)
{
wxDCClipper clip(dc, rect);
// ... drawing functions here are affected by clipping rect ...
}
void OtherFunction()
{
wxDC dc;
MyFunction(dc);
// ... drawing functions here are not affected by clipping rect ...
}
wxDCClipper
wxDCClipper is a helper class for setting a clipping region on a wxDC during its lifetime.
Definition: dc.h:1665
wxDC
A wxDC is a "device context" onto which graphics and text can be drawn.
Definition: dc.h:187

Note
  Unlike other similar classes such as wxDCFontChanger, wxDCClipper currently doesn't restore the previously active clipping region when it is destroyed but simply resets clipping on the associated wxDC. This may be changed in the future wxWidgets versions but has to be taken into account explicitly in the current one.

##

Library: wxCore

<>< =''>:</>&;&;< =''>\ </></>

See also
  wxDC::SetClippingRegion(), wxDCFontChanger, wxDCTextColourChanger, wxDCPenChanger, wxDCBrushChanger

## Public Member Functions
| wxDCClipper (wxDC &dc, const wxRegion &region)
| Sets the clipping region to the specified region/coordinates. More...
| wxDCClipper (wxDC &dc, const wxRect &rect)
| wxDCClipper (wxDC &dc, wxCoord x, wxCoord y, wxCoord w, wxCoord h)
| ~wxDCClipper ()
| Destroys the clipping region associated with the DC passed to the ctor. More...

## Constructor & Destructor Documentation

## ◆ wxDCClipper() [1/3]

wxDCClipper::wxDCClipper | ( | wxDC & | dc,
|  | const wxRegion & | region
| ) |  |

Sets the clipping region to the specified region/coordinates.

The clipping region is automatically unset when this object is destroyed.

## ◆ wxDCClipper() [2/3]

wxDCClipper::wxDCClipper | ( | wxDC & | dc,
|  | const wxRect & | rect
| ) |  |

## ◆ wxDCClipper() [3/3]

wxDCClipper::wxDCClipper | ( | wxDC & | dc,
|  | wxCoord | x,
|  | wxCoord | y,
|  | wxCoord | w,
|  | wxCoord | h
| ) |  |

## ◆ ~wxDCClipper()

wxDCClipper::~wxDCClipper | ( |  | ) |

Destroys the clipping region associated with the DC passed to the ctor.