Re: [get size and location of a user's selection]

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: [get size and location of a user's selection]

Harry Parker
Dear Adam,

You asked:

"Is there a way to determine the size and location of a selection made by the user ?
For example can I access the values in the makeOval(x, y, width, height) command ?"


Yes. Everything you need is described in the macro function page.
Just select the menu command Help->Macro Functions to get there.
Then search the page (Ctrl-F) for "Selection". Takes but a minute.
Here's what I found:

-----------------
getSelectionBounds(x, y, width, height)
Returns the smallest rectangle that can completely contain the current selection. x and y are the pixel coordinates of the upper left corner of the rectangle. width and height are the width and height of the rectangle in pixels. If there is no selection, returns (0, 0, ImageWidth, ImageHeight). See also: selectionType andsetSelectionLocation. getSelectionCoordinates(xCoordinates, yCoordinates)
Returns two arrays containing the X and Y coordinates of the points that define the current selection. See theSelectionCoordinatesmacro for an example.See also:selectionType,getSelectionBounds.
-------------------

(The links are live on the web page.) The Help menu is your friend.  Its worth your time skimming all of the Macro documentation.

You're welcome.

-- Harry

 



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page.
http://www.yahoo.com/r/hs