wxDCClipper Class Reference
[Graphics Device Interface (GDI)]

#include <wx/dc.h>

List of all members.


Detailed Description

wxDCClipper is a small helper class for setting a clipping region on a wxDC and unsetting it automatically. 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 ...
    }

Library:  wxCore

Category:  Graphics Device Interface (GDI)

See also:
wxDC::SetClippingRegion()

Public Member Functions

 wxDCClipper (wxDC &dc, const wxRegion &r)
 wxDCClipper (wxDC &dc, const wxRect &rect)
 wxDCClipper (wxDC &dc, int x, int y, int w, int h)

Constructor & Destructor Documentation

wxDCClipper::wxDCClipper ( wxDC dc,
const wxRegion r 
)

Sets the clipping region to the specified region/coordinates.

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

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

Sets the clipping region to the specified region/coordinates.

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

wxDCClipper::wxDCClipper ( wxDC dc,
int  x,
int  y,
int  w,
int  h 
)

Sets the clipping region to the specified region/coordinates.

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



wxWidgets logo

[ top ]