Skip to content

ElectronNativeImage.getAspectRatio method

ElectronNativeImage › getAspectRatio

Unofficial

Returns the image's aspect ratio. If scaleFactor is passed, this returns the aspect ratio corresponding to the image representation most closely matching the passed value.

Signature:

getAspectRatio(scaleFactor?: number | undefined): number

Parameters:

ParameterTypeDescription
scaleFactor?number | undefinedThe scale factor to get the aspect ratio for.

Returns: numberThe image's aspect ratio.