Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
Toggle table of contents sidebar

# DocumentImage.crop Method

Module: DocumentImage

## Definition

Crop a rectangular region of interest in the image according to the given bounds.

Python

    crop(self, left: int, top: int, width: int, height: int) -> DocumentImage

Parameters

> `left` int
> in Left bound of the crop to extract.
> `top` int
> in Top bound of the crop to extract.
> `width` int
> in Width of the crop to extract.
> `height` int
> in Height of the crop to extract.

Returns

> DocumentImage
> The extracted region of interest.

Exceptions

> DocumentException
> An error has occurred during Document Library execution.

Dart

    DocumentImage crop(int left, int top, int width, int height)

Parameters

> `left` int
> in Left bound of the crop to extract.
> `top` int
> in Top bound of the crop to extract.
> `width` int
> in Width of the crop to extract.
> `height` int
> in Height of the crop to extract.

Returns

> DocumentImage
> The extracted region of interest.

Exceptions

> DocumentException
> An error has occurred during Document Library execution.

C#

    public DocumentImage Crop(int left, int top, int width, int height)

Parameters

> `left` int
> in Left bound of the crop to extract.
> `top` int
> in Top bound of the crop to extract.
> `width` int
> in Width of the crop to extract.
> `height` int
> in Height of the crop to extract.

Returns

> DocumentImage
> The extracted region of interest.

Exceptions

> DocumentException
> An error has occurred during Document Library execution.

Java

    public DocumentImage crop(int left, int top, int width, int height) throws DocumentException

Parameters

> `left` int
> in Left bound of the crop to extract.
> `top` int
> in Top bound of the crop to extract.
> `width` int
> in Width of the crop to extract.
> `height` int
> in Height of the crop to extract.

Returns

> DocumentImage
> The extracted region of interest.

Exceptions

> DocumentException
> An error has occurred during Document Library execution.

Swift

    public func crop(left: Int32, top: Int32, width: Int32, height: Int32) throws -> DocumentImage

Parameters

> `left` Int32
> in Left bound of the crop to extract.
> `top` Int32
> in Top bound of the crop to extract.
> `width` Int32
> in Width of the crop to extract.
> `height` Int32
> in Height of the crop to extract.

Returns

> DocumentImage
> The extracted region of interest.

Exceptions

> DocumentException
> An error has occurred during Document Library execution.

C

    int id3DocumentImage_Crop (
        ID3_DOCUMENT_IMAGE hDocumentImage,
        int left,
        int top,
        int width,
        int height,
        ID3_DOCUMENT_IMAGE hDocumentImageCrop)

Parameters

> `hDocumentImage` ID3_DOCUMENT_IMAGE
> in Handle to the DocumentImage object.
> `left` int
> in Left bound of the crop to extract.
> `top` int
> in Top bound of the crop to extract.
> `width` int
> in Width of the crop to extract.
> `height` int
> in Height of the crop to extract.
> `hDocumentImageCrop` ID3_DOCUMENT_IMAGE
> out The extracted region of interest.

Returns

> `int`
> An error code.
> See id3DocumentError file for the list of possible error codes.