Dennis:

Thanks for your message. Let me try the double-buffer-operation.

Ouyang
Dennis Lee Bieber wrote:
> On 1 Aug 2006 01:10:18 -0700, "zxo102" <[EMAIL PROTECTED]> declaimed the
> following in comp.lang.python:
>
> >
> > I just wrote the code following the example you provided. The image
> > location can be controlled with the data from socket client. But only
> > one thing confuse me. When the image keeps moving to a new location,
> > the image at a "old" location is not deleted and  is left behind in the
> > frame. Do you know what is going on with it?  The location of image  is
> > processed in "def OnResult(self,event):" and is initialized in "def
> > __init__(self, parent, id):" of "class MainFrame" ( See the code
> > attached).
> >
>       Off hand, it is doing just what the code says it should.
>
>       Each time you update position, you are COPYING a SMALL rectangle
> (the "moved" image) into the larger frame... Only the pixels
> corresponding to the small rectangle are changed -- anything that was
> already in the frame stays there.
>
>       You might want to double-buffer the operations...
>
>       For each move:
>               clear an unseen "frame-sized" buffer
>               compute the new location of the "moved" image
>               blit the "moved" image into the unseen buffer
>               blit the full unseen buffer to the viewed frame (not to a
> portion of the frame, but replace the entire frame contents)
>
>       The double-buffer is to avoid annoying the viewer with the "flash"
> of clearing out the view frame before drawing the new image
>
> --
>       Wulfraed        Dennis Lee Bieber               KD6MOG
>       [EMAIL PROTECTED]               [EMAIL PROTECTED]
>               HTTP://wlfraed.home.netcom.com/
>       (Bestiaria Support Staff:               [EMAIL PROTECTED])
>               HTTP://www.bestiaria.com/

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to