cut()

Description

Cuts an area of image with the specified index in buffer. The remaining area is left as white once cut.

Syntax

ImageViewerObject.image.cut(index, left, top, right, bottom);

Parameters

<int> sImageIndex: specifies the index of image in buffer. The index is 0-based.
<int> left: specifies the x-coordinate of the upper-left corner of the rectangle.
<int> top: specifies the y-coordinate of the upper-left corner of the rectangle.
<int> right: specifies the x-coordinate of the lower-right corner of the rectangle.
<int> bottom: specifies the y-coordinate of the lower-right corner of the rectangle.

Return value

bool

true indicates success. false indicates failure.

Example

if (DCSObject) {
    var imageviewer = DCSObject.getImageViewer("ImageViewerContainer");
    imageviewer.image.cut(0, 0, 0, 300, 400);
}

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.

The value of top must be smaller than the value of bottom and the value of bottom must be positive.

When false is returned, check getErrorCode() or getErrorString() for error information.

See Also

.image.copyToImageViewer()
.ui.onimageareaselected
.ui.onimageareadeselected

Is this page helpful?

Leave a Reply

Your email address will not be published.