Skip to main content

resize

const resize: (fromWidth, fromHeight, toWidth, toHeight) => object;

Calculate the coordinates and size of the source and destination to fit the target aspect ratio.

Parameters​

ParameterTypeDescription
fromWidthnumberThe width of the source
fromHeightnumberThe height of the source
toWidthnumberThe width of the destination
toHeightnumberThe height of the destination

Returns​

object

NameType
sxnumber
synumber
swnumber
shnumber
dxnumber
dynumber
dwnumber
dhnumber