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.
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.
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.
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.
wxOverlay:
I've got 4(!) examples of Overlay here:
not sure why -- it's been a while!
This demo:
may be helpful.
-CHB
···
On Thu, Sep 22, 2016 at 5:45 AM, steve <oslocourse@gmail.com> wrote:
Thanks
Best regards
--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
I’d like to use wx.Overlay() but it doesn’t work when Double Buffering is turned on. Thus, I turn it off right before drawing the rubberband, and then turn it on again. Rubberband can be drawn using this workaround. But when I right click on the window to show a pop-up menu and then left click somewhere on the window to remove it, the screen flashes (although I had turned double buffering on). I don’t understand. Do you have any ideas why it happens?
Best regards
···
On Thursday, September 22, 2016 at 7:16:11 PM UTC+3, Chris Barker wrote:
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.
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.
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
I’d like to use wx.Overlay() but it doesn’t work when Double Buffering is turned on. Thus, I turn it off right before drawing the rubberband, and then turn it on again. Rubberband can be drawn using this workaround. But when I right click on the window to show a pop-up menu and then left click somewhere on the window to remove it, the screen flashes (although I had turned double buffering on). I don’t understand. Do you have any ideas why it happens?
Best regards
On Thursday, September 22, 2016 at 7:16:11 PM UTC+3, Chris Barker wrote:
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.
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.
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception