flicker in wxBufferedPaintDC

Markus von Ehr vonehr at ipm.fhg.de
Tue Aug 10 09:37:02 EDT 2004


Hi,

I actualize a buffer in an event handler routine:

if BUFFERED:
         # If doing buffered drawing, create the buffered DC, giving it
         # it a real DC to blit to when done.
         cdc = wxClientDC(self)
         dc = wxBufferedDC(cdc, self.buffer)

         dc.BeginDrawing()
         if self.image:
             dc.DrawBitmap(self.image.ConvertToBitmap(), 0,0)
         dc.EndDrawing()

and paint the buffer in the OnPaint method.

      def OnPaint(self, event):
         if BUFFERED:
             # Create a buffered paint DC.  It will create the real
             # wxPaintDC and then blit the bitmap to it when dc is
             # deleted.  Since we don't need to draw anything else
             # here that's all there is to it.
             dc = wxBufferedPaintDC(self, self.buffer)
         else:
             dc = wxPaintDC(self)
             # since we're not buffering in this case, we have to
             # paint the whole window, potentially very time consuming.
             self.DoDrawing(dc)


but the window is flickering. The window displays the liveimage of a 
connected camera.
How could I get rid of the flickering?

Thanks for any hints,

Markus



More information about the Python-list mailing list