[Tutor] Print Screen
Chris Hengge
pyro9219 at gmail.com
Fri Nov 3 19:27:21 CET 2006
Oh wow! That is great trick for lowering network requirements. Have you
actually implimented that into a working app for test? You could shave a bit
more from the bandwidth using that trick if you locked to a specific window
for transfer *thinking blinking tray icons etc would get stripped*. How are
you doing the intelligent transfer? Did you setup a grid on the screen and
only update if gridX has changes? Other then that, are there any resources
you can share for getting me started with my own VNC? Or do you by chance
have any design docs you created/followed I could review to get an idea of
the process for this? I'm thinking I'll probably have to find something in
another language and just try to duplicate it with python to get me started.
On 11/3/06, Luke Paireepinart <rabidpoobear at gmail.com> wrote:
>
> Chris Hengge wrote:
> > Wow.. I have visions of writing a little wanna-be VNC client/server
> > now using the ImageGrab.grab() =D
> > This ImageGrab trick does exactly what I wanted. Thanks for the tip!
> >
> > Actually, I want to write a little package for the learning experience
> > sometime over the holidays (plus I use VNC fairly often), but I can't
> > find any direction, or any already made packages for python for the
> > VNC protocol (no libs?).
> Heh, I was actually writing my own VNC, that's when I ran into the
> ImageGrab function.
> I also did something cool, which is :
> self.prevscr = self.currscr
> self.currscr = ImageGrab.grab().resize((800,600))
>
> diff = ImageChops.difference(self.prevscr,self.currscr)
>
> Obviously you need a currscr before you start, which I declared during
> the initialization of the class.
> The cool part of this is that the ImageChops difference will return
> black pixels in any area of the screen that hasn't changed.
> so you can just send the changed parts over the network (if you have a
> good algorithm to discard the unchanged portions).
> Would be much faster than sending the whole screen every frame, obviously.
> Not CPU-faster, but network-faster.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20061103/d4c55258/attachment.htm
More information about the Tutor
mailing list