CImage:Shift


The Shift method moves the image in the x and y directions. This transformation preserves the world coordinate calibration of the image, if one exists.

Syntax

bSuccess = CImage:Shift( x, y )

where

    x and y are the shifts and may be numbers or strings.

    bSuccess is the returned success code. On success it is true, otherwise false.

  

Shifts are considered positive if the image is moved toward increasing x or increasing y.

If either of the shifts is a fractional pixel amount, the image is resampled. The resampling is controlled by members of the ResampleParams table. The image is not resampled if both x and y shifts are integral values. When resampling is needed, you can either do nothing and use the default parameters or set specific parameters and then call SetResampleParams function.

Example

Suppose an image is displayed in a CImageView named V. The following script shifts the displayed image 10 pixels in x and 20.52 pixels in y:

I = V:GetImage()

-- attach the current displayed image

I:Shift( 10, 20.52 )

-- perform the operation

V:Update()

-- update the display after the shift

Related Topics

Affine

Offset

Image Geometry Methods

CImage class

SetResampleParams