Stefan Holmgren wrote:
is it possible to speed up the refresh for a dc?
my python code looks like this,
(created on a wxScrolledWindow:).----------------
def onPaint(self, event):
self.doDraw(wxPaintDC(self))def doDraw(self, dc):
dc.SetUserScale(self.scale, self.scale)alot of this.....
dc.DrawPolygon(drawlist)
.....
---------------
when I change 'self.scale' or a color for an
object I have to make a Refresh().
Chris Barker wrote:
Double buffer. This is usually used to speed refreshes if the drawing
hasn't changed, but if the drdawing has changed, it may be that only
part of the drawing is changing regularly, and the rest is a background
of sorts. In this case, you could store the background in a buffer, and
only re-draw the foreground.
Tnx Chris, wxClientDC was a nice way to draw on the existing dc.
But, when I have a moving object, (created with wxClientDC),
I have to reset the background object.
I tried:
dc.SetClippingRegion
dc.Clear
dc.DestroyClippingRegion
but, instead of clear I want to do a refresh for that region with object from my doDraw.
is there a way to refresh a dc region?
And please... How do I create a Double Buffer...
add an example with my code above, or do I have to change my code from scratch?
Tnx
Stefan Holmgren