RSS/Atom feed Twitter
Site is read-only, email is disabled

PyGimp: letting the use pick coordinates

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

PyGimp: letting the use pick coordinates Ryan Krauss 06 Jul 16:25
  PyGimp: letting the use pick coordinates Alexia Death 06 Jul 16:37
Ryan Krauss
2009-07-06 16:25:39 UTC (over 15 years ago)

PyGimp: letting the use pick coordinates

I am using the GIMP and a Wacom tablet as a digital blackboard for a course I am teaching this summer. With Python and PyGimp, it is going really well (other than my bad hand writing made worse by the tablet - it is weird writing on the tablet and having to look to the screen to see what you have written). Example lecture notes can be seen here: http://home.cs.siue.edu/rkrauss/452/lectures/07_02_09/index.html

We are coming into a mathematically intensive part of the course and I feel like my handwritting has become a barrier. I am creating my own text tool that use Latex and dvipng. The hard part is already done: I have a wxPython application with a text control and a png preview portion and it is basically working. I am now working on better GIMP integration. Right now I type in the equations in my wxPython application and preview the png there. When I want to paste the png into my lecture slide, I have to switch back to GIMP and press a key that is a short cut for a PyGimp script to load the cached png. Then I position it on the slide with the move tool. Not bad, but not as nice as Gimp's text tool.

I would like my Latex enabled approach to act like the regular text tool. The main thing I don't know how to do is allow the user (me) to click on a spot on the current image and pass those coordinates to PyGimp so that I can use that as the top left corner of my png. Does my question make sense? Is there an easy way to allow the user to click on a spot on the image and get the coordinates from PyGimp?

Thanks,

Ryan

Alexia Death
2009-07-06 16:37:31 UTC (over 15 years ago)

PyGimp: letting the use pick coordinates

On Mon, Jul 6, 2009 at 5:25 PM, Ryan Krauss wrote:

I would like my Latex enabled approach to act like the regular text tool. The main thing I don't know how to do is allow the user (me) to click on a spot on the current image and pass those coordinates to PyGimp so that I can use that as the top left corner of my png. Does my question make sense? Is there an easy way to allow the user to click on a spot on the image and get the coordinates from PyGimp?

In various scripts when I have needed to indicate a location on a canvas Ive used selections. Id say using an upper left corner of a selection you draw first is as good as its going to get...