DocumentImage.downscaleTo Method¶
Module: DocumentImage
Definition¶
Downscales the image so that its maximum dimension equals the given maximum size, while preserving the aspect ratio.
Note
If the maximum dimension is already smaller than the given maximum size, the function does nothing and the returned scale ratio is 1.
downscale_to(self, dst_document_image: DocumentImage, max_size: int) -> float
Parameters
dst_document_imageDocumentImagein Destination image.max_sizeintin Maximum image size, in pixels. The value must be greater than 0.
Returns
floatThe scaling ratio applied to the image. Range is ]0:1].
Exceptions
An error has occurred during Document Library execution.
double downscaleTo(DocumentImage dstDocumentImage, int maxSize)
Parameters
dstDocumentImageDocumentImagein Destination image.maxSizeintin Maximum image size, in pixels. The value must be greater than 0.
Returns
doubleThe scaling ratio applied to the image. Range is ]0:1].
Exceptions
An error has occurred during Document Library execution.
public float DownscaleTo(DocumentImage dstDocumentImage, int maxSize)
Parameters
dstDocumentImageDocumentImagein Destination image.maxSizeintin Maximum image size, in pixels. The value must be greater than 0.
Returns
floatThe scaling ratio applied to the image. Range is ]0:1].
Exceptions
An error has occurred during Document Library execution.
public float downscaleTo(DocumentImage dstDocumentImage, int maxSize) throws DocumentException
Parameters
dstDocumentImageDocumentImagein Destination image.maxSizeintin Maximum image size, in pixels. The value must be greater than 0.
Returns
floatThe scaling ratio applied to the image. Range is ]0:1].
Exceptions
An error has occurred during Document Library execution.
public func downscaleTo(dstDocumentImage: DocumentImage, maxSize: Int32) throws -> Float
Parameters
dstDocumentImageDocumentImagein Destination image.maxSizeInt32in Maximum image size, in pixels. The value must be greater than 0.
Returns
FloatThe scaling ratio applied to the image. Range is ]0:1].
Exceptions
An error has occurred during Document Library execution.
int id3DocumentImage_DownscaleTo (
ID3_DOCUMENT_IMAGE hDocumentImage,
ID3_DOCUMENT_IMAGE hDstDocumentImage,
int maxSize,
float * scaleRatio)
Parameters
hDocumentImageID3_DOCUMENT_IMAGEin Handle to the DocumentImage object.hDstDocumentImageID3_DOCUMENT_IMAGEin Destination image.maxSizeintin Maximum image size, in pixels. The value must be greater than 0.scaleRatiofloat *out The scaling ratio applied to the image. Range is ]0:1].
Returns