[Image-SIG] Displaying Images and getting input from Mouse

Alex Tweedly alex at tweedly.net
Thu May 4 18:46:53 CEST 2006

Wynand Singels wrote:

>Hi there everyone
>I'm trying to figure out the best (and fastest way) to display a JPEG image
>and then input several (x,y) coordinate pairs from mouse clicks on the
>The other option I was looking at was using wxPython - a staticbitmap with
>EVT_LEFT_DOWN or something like that. 
You should be able to do it in wxPython - what problems did you encounter.

Alternatively, there's an easier alternative in PythonCard - basically a 
wrapper around wxPython to make it easier to do most straightforward 
things -    www.pythoncard.org

One of the sample programs that comes with it is a simple picture viewer 
(in samples/pictureViewer), which shows files scaled in various ways. 
Adding the following few lines to it will make it do what (I think) you 

>     def on_bufOff_mouseDown(self, event):
>         photosize = self.bmp.getSize()
>         windowsize = self.components.bufOff.size
>         print event.x * photosize[0] / windowsize[0], event.y * 
> photosize[1] / windowsize[1]

>Please take into account that my end product will have to have a full GUI.
>Is there some other package I can use? Or am I missing some part of wxPython
>that can do this? Is there anyone that has done anything similar?
"a full GUI" covers a broad range of needs - but most straightforward 
things can be done in Pythoncard, and if you do need something it can't 
yet do,  you have direct access to the rest of wxPython (so you can use 
Pythoncard simply as an "easy entry" to the world of wxPython).

Alex Tweedly       http://www.tweedly.net

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.5.3/331 - Release Date: 03/05/2006

More information about the Image-SIG mailing list