crop()

Description

Crops an image in the editor.

Syntax

func crop(x1: Int, y1: Int, x2: Int, y2: Int)

Parameters

x1:Int specifies the x-coordinate of the upper-left corner of the rectangle.
y1:Int specifies the y-coordinate of the upper-left corner of the rectangle.
x2:Int specifies the x-coordinate of the lower-right corner of the rectangle.
y2:Int specifies the y-coordinate of the lower-right corner of the rectangle.

Return value

Void

Remarks

If the value of left or top is negative, it will be treated as zero.

If the value of right is larger than the width of image, it will be treated as the width of image.

If the value of bottom is larger than the height of image, it will be treated as the height of image.

The value of left must be smaller than the value of right and the value of right must be positive. Otherwise, the method will throw DcsValueNotValidException.

The value of top must be smaller than the value of bottom and the value of bottom must be positive. Otherwise, the method will throw DcsValueNotValidException.

Is this page helpful?

Leave a Reply

Your email address will not be published.