CImage:ScaleXy


The ScaleXy method scales the image independently in each axis. Scaling is relative to 1.0.

Syntax

bResult = CImage:ScaleXy( sx, sy, bResize=false )

bullet.gif    sx and sy are the multiplication factors and may be a number or string.

bullet.gif    bResize controls whether the image dimension is adjusted for the scale factor.

bullet.gif    On success, this method returns true.

bullet.gif    On failure, this method returns false.

Remarks

One application of this method is to remove the distortion present in images taken with a detector having non-square pixels.

The optional bResize controls whether the image dimension (pixel count) is changed to accommodate the scaling.

Example

Suppose an image is displayed in a CImageView named V. The following script scales the image by 1.2 times in x and 1.44 times in y, without changing the number of image pixels (bResize=false):

I = V:GetImage()

-- attach the current displayed image

I:ScaleXy( 1.2, 1.44 )

-- perform the operation

V:Update()

-- update the display after the scale

Related Topics

CImage class, Scale


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