Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Image grab in Python

Reply
Thread Tools

Re: Image grab in Python

 
 
David
Guest
Posts: n/a
 
      05-04-2008
On Sun, May 4, 2008 at 5:28 PM, Valerio Valerio <> wrote:
> I can grab the image, I need a way of grab the region size with the mouse,
> a easy way of the user select a region of the image to analyze, something
> like the "Rectangle selection tool" of gimp.
>


I assume what you want to do is allow the user to drag the mouse
across your desktop, and your program, running in the background,
picks this up? As opposed to the user making a rectangular selection
entirely within your app.

I think the simplest way to do this is to capture the entire screen,
then show it as an image on a window covering the entire screen (eg:
fullscreen mode, or a regular window without decorations). Then
listen for mouse events. There should be a way to show the 'rectangle
elastic band' at the same time. Otherwise just draw a rectangle
between where the user first clicked and where the mouse is now (until
they release the mouse button).

Another way would be to listen to all events sent through X, and act
based on the mouse events. VNC does something similar.

A good starting point would be the Python xlib libraries:

http://python-xlib.sourceforge.net/

David.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Grab Image From Web Server Hunter Hillegas Ruby 6 04-20-2009 01:48 PM
firefox add-on to grab python code handily? CM Python 3 05-11-2008 06:10 AM
Re: Image grab in Python David Python 0 05-04-2008 06:09 PM
Looking for a module (or anything) to grab a webcam image PB Perl Misc 4 11-02-2007 12:22 PM
Using SNMP to grab Input and Output Rates for 95th percentile billing Rick Kunkel Cisco 2 02-05-2005 12:06 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57