[wxPython-users] Animation glitch in Windows, but not under Linux

Robin Dunn robin at alldunn.com
Fri Aug 3 12:31:44 PDT 2007


Jasper Stolte wrote:
> Hi guys, I've got a bit of a problem.

> So what exactly goes wrong? I'm using the motion event of the mouse to 
> draw onto a bitmap with a MemoryDC. Then I call RefreshRect to cause a 
> paint event. On the paint event I have a BufferedPaintDC drawing the 
> bitmap to the screen. In Linux, this works fine, but under windows there 
> are sometimes (minor) horizontal artifacts in the rect I'm updating.. 

You are seeing the rectangle being cleared before it is being drawn 
again.  If you change your RefreshRect() calls to pass False for the 
eraseBackground parameter then it should go away.  Since you are drawing 
the whole rectangle anyway there is no need to clear it first.  You 
don't see it on Linux because the refreshes are buffered there, so the 
erase and the draw end up getting handled at the same time.

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list