Drawing a rubberband on a panel without redrawing everthing in wxpython
<p>I use a wx.PaintDC() to draw shapes on a panel. After drawing the shapes, when I left click and drag mouse, a rubberband (transparent rectangle) is drawn over shapes. While dragging the mouse, for each motion of mouse, an EVT_PAINT is sent and everything (all shapes and rectangle) is redrawn.</p>

<p>How do I just draw the rubberband over the existing shapes (I don't want to redraw the shapes), I mean, it would be nice if I can save the existing shapes on some DC object and just draw the rubberband on it. So that the application will draw it faster.</p>

<p>You presumably want to have a look at <a href="https://wxpython.org/Phoenix/docs/html/wx.Overlay.html?highlight=overlay" rel="nofollow"><code>wx.Overlay</code></a>. Look <a href="https://github.com/wxWidgets/wxPython/blob/master/sandbox/test_Overlay.py" rel="nofollow">here</a> for an example.</p>

python wxpython