File: wx.BufferedPaintDC.txt

package info (click to toggle)
wxpython4.0 4.0.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 211,112 kB
  • sloc: cpp: 888,355; python: 223,130; makefile: 52,087; ansic: 45,780; sh: 3,012; xml: 1,534; perl: 264
file content (153 lines) | stat: -rw-r--r-- 5,061 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
.. 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>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.DC.html" title="wx.DC" alt="" coords="43,83,115,112"/> <area shape="rect" id="node3" href="wx.MemoryDC.html" title="wx.MemoryDC" alt="" coords="22,160,135,189"/> <area shape="rect" id="node2" href="wx.Object.html" title="wx.Object" alt="" coords="37,5,119,35"/> <area shape="rect" id="node5" href="wx.BufferedDC.html" title="wx.BufferedDC" alt="" coords="21,237,136,267"/> <area shape="rect" id="node4" href="wx.BufferedPaintDC.html" title="wx.BufferedPaintDC" alt="" coords="5,315,152,344"/> </map> 
   </p>

|


|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:

      **~~~**

      
      **__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
      
      
      
      
      
      
      **~~~**

      
      **__init__** `(self, window, style=BUFFER_CLIENT_AREA)`
      
      
      
      
      :param `window`: 
      :type `window`: wx.Window
      :param `style`: 
      :type `style`: int
      
      
      
      
      
      
      **~~~**