# wxBufferedPaintDC Class Reference
[Device Contexts]

`#include <wx/dcbuffer.h>`

Inheritance diagram for wxBufferedPaintDC:
[legend]

## Detailed Description

This is a subclass of wxBufferedDC which can be used inside of an `EVT_PAINT()` event handler to achieve double-buffered drawing.

Just use this class instead of wxPaintDC and make sure wxWindow::SetBackgroundStyle() is called with wxBG_STYLE_CUSTOM somewhere in the class initialization code, and that's all you have to do to (mostly) avoid flicker. The only thing to watch out for is that if you are using this class together with wxScrolled, you probably do not want to call wxScrolled::PrepareDC() on it as it already does this internally for the real underlying wxPaintDC.

##

Library: wxCore

Category: Device Contexts

See also:
  wxDC, wxBufferedDC, wxAutoBufferedPaintDC, wxPaintDC

## Public Member Functions
virtual | ~wxBufferedPaintDC ()
| Copies everything drawn on the DC so far to the window associated with this object, using a wxPaintDC.
| wxBufferedPaintDC (wxWindow *window, wxBitmap &buffer, int style=wxBUFFER_CLIENT_AREA)
| As with wxBufferedDC, you may either provide the bitmap to be used for buffering or let this object create one internally (in the latter case, the size of the client part of the window is used).
| wxBufferedPaintDC (wxWindow *window, int style=wxBUFFER_CLIENT_AREA)
| As with wxBufferedDC, you may either provide the bitmap to be used for buffering or let this object create one internally (in the latter case, the size of the client part of the window is used).

List of all members.

## Constructor & Destructor Documentation

wxBufferedPaintDC::wxBufferedPaintDC | ( | wxWindow * | window,
|  | wxBitmap & | buffer,
|  | int | style = `wxBUFFER_CLIENT_AREA` |
| ) |  |  |

As with wxBufferedDC, you may either provide the bitmap to be used for buffering or let this object create one internally (in the latter case, the size of the client part of the window is used).

Pass wxBUFFER_CLIENT_AREA for the style parameter to indicate that just the client area of the window is buffered, or wxBUFFER_VIRTUAL_AREA to indicate that the buffer bitmap covers the virtual area.

wxBufferedPaintDC::wxBufferedPaintDC | ( | wxWindow * | window,
|  | int | style = `wxBUFFER_CLIENT_AREA` |
| ) |  |  |

As with wxBufferedDC, you may either provide the bitmap to be used for buffering or let this object create one internally (in the latter case, the size of the client part of the window is used).

Pass wxBUFFER_CLIENT_AREA for the style parameter to indicate that just the client area of the window is buffered, or wxBUFFER_VIRTUAL_AREA to indicate that the buffer bitmap covers the virtual area.

virtual wxBufferedPaintDC::~wxBufferedPaintDC | ( |  | ) | `[virtual]`

Copies everything drawn on the DC so far to the window associated with this object, using a wxPaintDC.

|  | [ top ]