CImage:PtInside
The PtInside method tests whether a point specified in pixel coordinates is interior to the image.
bResult = CImage:PtInside( x, y ) |
x and y are image coordinates in pixel units.
On success, this method returns true.
On failure, this method returns false.
This method is useful for the non-trivial cases of when a coordinate is calculated or is expressed in world coordinates. In the latter case, call WcsToXy to convert to pixel coordinates before calling this method.
Assume a displayed image is attached to a CImageView namedI. 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 |
Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.