Login  Register

Re: Getting Coordinates of Line Selection

Posted by dscho on Jul 18, 2007; 11:49am
URL: http://imagej.273.s1.nabble.com/Trying-to-understand-algorithms-tp3698773p3698776.html

Hi,

On Wed, 18 Jul 2007, Ryohei Thomas Nakano wrote:

> I'm writing plugin using Straight Line selection.
> I want to get coordinate data or just an angle data is OK.
> (x1, y1)  and (x2, y2), or the angel.
> when rectangular selection was used, it greatly work,
> but i have no idea when straight line selection.
> I would be grateful for just a little help.

A straight line selection is of type ij.gui.Line.  The only method to get
at the coordinates that I know of, is the method "getPolygon()", which
returns a java.awt.Polygon.  If the width of the line selection is larger
than 1, then you will get a rectangle instead of a line.

Hth,
Dscho