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
| Parameter | Type | Description |
|---|---|---|
fromWidth | number | The width of the source |
fromHeight | number | The height of the source |
toWidth | number | The width of the destination |
toHeight | number | The height of the destination |
Returns
object
| Name | Type |
|---|---|
dh | number |
dw | number |
dx | number |
dy | number |
sh | number |
sw | number |
sx | number |
sy | number |