CImage:PtInside
The PtInside method tests whether a point is interior to the image.
bSuccess = CImage:PtInside( nAxis[] ) bSuccess = CImage:PtInside( x, y ) bSuccess = CImage:PtInside( n ) where |
nAxis[] is a n-Dimensional coordinate array.
x and y are image coordinates in pixel units.
n is an integer index between 1 and the number of pixels in the image.
bSuccess is the returned success code. On success it is true, otherwise false.
This method is useful for the non-trivial cases when a coordinate is calculated or expressed in world coordinates. In the latter case, call WcsToXy to convert to pixel coordinates before calling this method. See the example below.
Assume an image is displayed image is a CImageView window. The following script converts a coordinate (a,d) into pixel coordinates and then tests whether the point (x,y) is inside the image:
|
-- create a CRect object |
|
-- convert to pixel coordinates |
|
-- returns true if x,y is inside the image |
|
-- result: Inside = 1 |