set_desired_size method

set_desired_size

Sets desired width and height of image.

def set_desired_size(self, desired_width, desired_height):
    ...
ParameterTypeDescription
desired_widthintdesired width in pixels
desired_heightintdesired height in pixels

Remarks

NOTE: This member is now obsolete. Instead, please use ImageOrPrintOptions.set_desired_size by setting param keepAspectRatio to false. This property will be removed 12 months later since May 2023. Aspose apologizes for any inconvenience you may have experienced.

set_desired_size

Sets desired width and height of image.

def set_desired_size(self, desired_width, desired_height, keep_aspect_ratio):
    ...
ParameterTypeDescription
desired_widthintdesired width in pixels
desired_heightintdesired height in pixels
keep_aspect_ratioboolwhether to keep aspect ratio of origin image

Remarks

The width and height of the output image in pixels will be only based on the set desired width and height.

The ImageOrPrintOptions.horizontal_resolution and ImageOrPrintOptions.vertical_resolution will not effect the width and height of the output image in this case.

See Also