getSelect
Top  Previous  Next

getSelect (integer Image, integer& Left, integer& Top, integer& Right, integer& Bottom )
or
var = getSelect
(integer Image, integer& Mode )

Use this function to retrieve the coordinates of the bounding rectangle of the selection on an image.

Parameters
 
Image  
 
An integer between 1 and 116 specifying the frame number of the image containing the selection. Values in the range of 100-116 correspond to hidden frames.  
 
Left, Top  
Integers that return the coordinates of the top left corner of the selection's bounding rectangle.  
 
Right, Bottom  
 
Integers that return the coordinates of the top left corner of the selection's bounding rectangle.  
 
Level  
 
An enumerated integer that describes the mode for the alternative syntax. Must be one of the following values:  
 
SEL_LEFT=1 – returns the leftmost position of the selection  
SEL_TOP=2 – returns the topmost position of the selection  
SEL_RIGHT=3 – returns the rightmost position of the selection  
SEL_BOTTOM=4 – returns the bottommost position of the selection  
 
Error flags

ERR_OK  
 
The flag set if successful.  
 
ERR_FAILED  
 
The flag set if failed.  
 
Example

The following set of statements creates a polygonal selection, retrieves the coordinates of its bounding rectangle and prints the information in the terminal window:  
 
setCurDir("samples")  
loadIm (1,"sample14.iwd")  
setSelect(1,SH_FREE,SEL_NEW,98,150,171,77,242,224,141,243,98,150)  
getSelect (1,x1,y1,x2,y2)  
print x1  
print y1   
print x2  
print y2