# wxAutoBufferedPaintDC Class Reference
[Device Contexts]

`#include </home/work/projects/wx/2.9/wx/interface/wx/dcbuffer.h>`

Inheritance diagram for wxAutoBufferedPaintDC:
[legend]

## Detailed Description

This wxDC derivative 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 difference between wxBufferedPaintDC and this class is that this class won't double-buffer on platforms which have native double-buffering already, avoiding any unnecessary buffering to avoid flicker.

wxAutoBufferedPaintDC is simply a typedef of wxPaintDC on platforms that have native double-buffering, otherwise, it is a typedef of wxBufferedPaintDC.

##

Library: wxBase
Category: Device Contexts

See also:
  wxDC, wxBufferedPaintDC, wxPaintDC

## Public Member Functions

| wxAutoBufferedPaintDC (wxWindow *window)
| Constructor.

List of all members.

## Constructor & Destructor Documentation

wxAutoBufferedPaintDC::wxAutoBufferedPaintDC | ( | wxWindow * | window | ) |

Constructor.

Pass a pointer to the window on which you wish to paint.

|  | [ top ]