CImage:Affine CImage:Expand

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.

Syntax

bResult = CImage:Crop( CRect )

bullet.gif    On success, this method returns true

bullet.gif    On failure, this method returns false.

Remarks

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.

Example

Assume that an image is displayed in a CImageView named V. The following script crops a subimage from the image cursor:

I = V:GetImage()

-- attach the displayed image to the CImage

R = V:GetCursorRect()

-- get the cursor extent as a CRect

I:Crop( R )

--crop the image to the image cursor

Related Topics

CImage class, CImageView, CRect class


Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.