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

Creating a layer from a selection or pasting to a specified x, y coorinate

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.

Creating a layer from a selection or pasting to a specified x, y coorinate Ryan Krauss 06 Jul 17:15
  Creating a layer from a selection or pasting to a specified x, y coorinate Ryan Krauss 06 Jul 20:07
Ryan Krauss
2009-07-06 17:15:45 UTC (over 15 years ago)

Creating a layer from a selection or pasting to a specified x, y coorinate

OK, so following Alexia's suggestion, I am going to plan on selecting ahead of time the rectangle I want my text to paste into. The upper left corner of this selection will then be the upper left corner that I want to paste my png to. How do I do that? I thought about creating a layer the same size as the selection rectangle and pasting to (0,0) on that layer. I see in the pdb how to create a layer with a certain width and height, but I don't see how to specify the offset. And I don't see how to paste to a specific set of coordinates. Can this be done? If I use pdb.gimp_edit_paste_as_new, can I get the coordinates of the pasted selection and then move the floating selection before anchoring? What is the right approach?

Thanks,

Ryan

On Mon, Jul 6, 2009 at 9:37 AM, Alexia Death wrote:

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...

-- --Alexia

Ryan Krauss
2009-07-06 20:07:13 UTC (over 15 years ago)

Creating a layer from a selection or pasting to a specified x, y coorinate

OK, I think I have solved my problem. You have to know what to search for in the pdb. I think this will do what I need: pdb.gimp_layer_set_offsets

There is nothing in the pdb browser for moving a layer, you have to offset it.

On Mon, Jul 6, 2009 at 10:15 AM, Ryan Krauss wrote:

OK, so following Alexia's suggestion, I am going to plan on selecting ahead of time the rectangle I want my text to paste into. The upper left corner of this selection will then be the upper left corner that I want to paste my png to. How do I do that? I thought about creating a layer the same size as the selection rectangle and pasting to (0,0) on that layer. I see in the pdb how to create a layer with a certain width and height, but I don't see how to specify the offset. And I don't see how to paste to a specific set of coordinates. Can this be done? If I use pdb.gimp_edit_paste_as_new, can I get the coordinates of the pasted selection and then move the floating selection before anchoring? What is the right approach?

Thanks,

Ryan

On Mon, Jul 6, 2009 at 9:37 AM, Alexia Death wrote:

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...

-- --Alexia