.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2018 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.BufferedPaintDC:

==========================================================================================================================================
|phoenix_title|  **wx.BufferedPaintDC**
==========================================================================================================================================

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

Just use this class instead of :ref:`wx.PaintDC`  and make sure :meth:`wx.Window.SetBackgroundStyle`   is called with ``wx.BG_STYLE_PAINT`` 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 :ref:`wx.Scrolled`, you probably do **not**  want to call :meth:`wx.Scrolled.PrepareDC`   on it as it already does this internally for the real underlying :ref:`wx.PaintDC`. 







         



.. seealso:: :ref:`wx.DC`, :ref:`wx.BufferedDC`, :ref:`wx.AutoBufferedPaintDC`, :ref:`wx.PaintDC`    







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>BufferedPaintDC</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.BufferedPaintDC_inheritance.png" alt="Inheritance diagram of BufferedPaintDC" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.BufferedPaintDC.html" title="This is a subclass of wx.BufferedDC  which can be used inside of an  ``EVT_PAINT()``   event handler to achieve double-buffered drawing." alt="" coords="5,315,161,344"/> <area shape="rect" id="node2" href="wx.BufferedDC.html" title="This class provides a simple way to avoid flicker: when drawing on it, everything is in fact first drawn on an in-memory buffer (a wx.Bitmap) and then copied to the screen, using the associated wx.DC, only once, when this object is destroyed." alt="" coords="23,237,144,267"/> <area shape="rect" id="node3" href="wx.MemoryDC.html" title="A memory device context provides a means to draw graphics onto a bitmap." alt="" coords="24,160,143,189"/> <area shape="rect" id="node4" href="wx.DC.html" title="A wx.DC  is a `'device context'`  onto which graphics and text can be drawn." alt="" coords="47,83,119,112"/> <area shape="rect" id="node5" href="wx.Object.html" title="This is the root class of many of the wxWidgets classes." alt="" coords="39,5,127,35"/> </map> 
   </p>
   </div>

|


|sub_classes| Known Subclasses
==============================

:ref:`wx.AutoBufferedPaintDC`

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.BufferedPaintDC.__init__`                                             As with :ref:`wx.BufferedDC`, 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).
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.BufferedPaintDC(BufferedDC)

   **Possible constructors**::

       BufferedPaintDC(window, buffer, style=BUFFER_CLIENT_AREA)
       
       BufferedPaintDC(window, style=BUFFER_CLIENT_AREA)
       
   
   This is a subclass of BufferedDC which can be used inside of an
   EVT_PAINT() event handler to achieve double-buffered drawing.



   .. method:: __init__(self, *args, **kw)

      As with :ref:`wx.BufferedDC`, 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 ``wx.BUFFER_CLIENT_AREA`` for the `style`  parameter to indicate that just the client area of the window is buffered, or ``wx.BUFFER_VIRTUAL_AREA`` to indicate that the buffer bitmap covers the virtual area.                   


      |overload| Overloaded Implementations:

      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self, window, buffer, style=BUFFER_CLIENT_AREA)`
      
      
      
      
      :param `window`: 
      :type `window`: wx.Window
      :param `buffer`: 
      :type `buffer`: wx.Bitmap
      :param `style`: 
      :type `style`: int
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self, window, style=BUFFER_CLIENT_AREA)`
      
      
      
      
      :param `window`: 
      :type `window`: wx.Window
      :param `style`: 
      :type `style`: int
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`