CImage:PtInside
The PtInside method tests whether a point specified in pixel coordinates is interior to the image.
bResult = CImage:PtInside( x, y ) |
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 fragment 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 |