CImage:Crop
The Crop method trims a rectangular subimage out of the image. This transformation preserves the world coordinate calibration of the image, if one exists.
bResult = CImage:Crop( CRect ) |
The crop region is passed as a CRect object containing the min and max x and y limits of the sub-image. These pixel coordinates are 1-based, meaning that pixel (1,) is at the origin of the image.
Assume that an image is displayed in a CImageView named V. The following script fragment crops a subimage from the image cursor:
|
-- attach the displayed image to the CImage |
|
-- get the cursor extent as a CRect |
|
--crop the image to the image cursor |
CImage , CImageView , CRect