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

Plugin/Script/gimp source code:How do I draw a vertical line with just a click of a button?

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.

kenny.law@net-tribe.com
2003-06-01 21:02:28 UTC (almost 21 years ago)

Plugin/Script/gimp source code:How do I draw a vertical line with just a click of a button?

Hi everyone,

I have been cracking my head for the past day trying to think of a way to draw a vertical line with just a simple click of the mouse.

Basically, what I have is this:
On my image, I have two horizontal lines, I want a tool that will allow me to just click anywhere between these two lines and draw a vertical line(width of 1 pixel) connecting both horizontal lines.

I have tried to think of ways to do it, like creating my own brush(too inaccurate), or writing a script to do it(no idea where to find the function to handle mouse events).

Basically, the best idea that has come to me is to sort of go into the gimp source code and write a tool that basically works like the bucket fill tool(the button that has a paint bucket on it). I will just click anywhere between the two lines and this tool automatically helps me draw a straight vertical line across the two lines.

Can anyone please advice me on a better way to do this(basically simpler way since I have no experience checking out gimp's source code), or maybe even telling me if the way I'm going is feasible. I really need some input here so if you need any clarifications, feel free to ask.

Thanks in advance, Kenny

Branko Collin
2003-06-01 23:52:22 UTC (almost 21 years ago)

Plugin/Script/gimp source code:How do I draw a vertical line with just a click of a button?

On 2 Jun 2003, at 3:02, kenny.law@net-tribe.com wrote:

I have been cracking my head for the past day trying to think of a way to draw a vertical line with just a simple click of the mouse.

Basically, what I have is this:

On my image, I have two horizontal lines, I want a tool that will allow me to just click anywhere between these two lines and draw a vertical line(width of 1 pixel) connecting both horizontal lines.

I have tried to think of ways to do it, like creating my own brush(too inaccurate), or writing a script to do it(no idea where to find the function to handle mouse events).

Basically, the best idea that has come to me is to sort of go into the gimp source code and write a tool that basically works like the bucket fill tool(the button that has a paint bucket on it). I will just click anywhere between the two lines and this tool automatically helps me draw a straight vertical line across the two lines.

Can anyone please advice me on a better way to do this(basically simpler way since I have no experience checking out gimp's source code), or maybe even telling me if the way I'm going is feasible. I really need some input here so if you need any clarifications, feel free to ask.

Click the first point.

Shift-click the second point.

For a more elaborate explanation, please read .

Christopher W. Curtis
2003-06-02 05:19:31 UTC (almost 21 years ago)

Plugin/Script/gimp source code:How do I draw a vertical line with just a click of a button?

On 06/01/03 15:02, kenny.law@net-tribe.com wrote:

I have been cracking my head for the past day trying to think of a way to draw a vertical line with just a simple click of the mouse.

On my image, I have two horizontal lines, I want a tool that will allow me to just click anywhere between these two lines and draw a vertical line(width of 1 pixel) connecting both horizontal lines.

Well, what you want to do is click on the first point, then hold down the shift key and click on the second point. For more accuracy, and even something of a preview, you can drag the rulers onto the image right where the line should be. If you really want to use a script, this should be very straightforward. A quick google search for "gimp script example" brings up this informative looking site:

http://pingus.seul.org/~grumbel/gimp/script-fu/script-fu-tut.html

rgds, Chris