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): number

Parameters:

ParameterTypeDescription
scaleFactor?numberThe scale factor to get the aspect ratio for.

Returns: number — The image's aspect ratio.