docs: document optional scaleFactor param to nativeImage fns (#23671)

This commit is contained in:
Shelley Vohr 2020-05-20 18:52:48 -07:00 committed by GitHub
parent df53816eea
commit 21a6062a31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -266,9 +266,13 @@ image instead of a copy, so you _must_ ensure that the associated
Returns `Boolean` - Whether the image is empty.
#### `image.getSize()`
#### `image.getSize([scaleFactor])`
Returns [`Size`](structures/size.md)
* `scaleFactor` Double (optional) - Defaults to 1.0.
Returns [`Size`](structures/size.md).
If `scaleFactor` is passed, this will return the size corresponding to the image representation most closely matching the passed value.
#### `image.setTemplateImage(option)`
@ -303,10 +307,18 @@ Returns `NativeImage` - The resized image.
If only the `height` or the `width` are specified then the current aspect ratio
will be preserved in the resized image.
#### `image.getAspectRatio()`
#### `image.getAspectRatio([scaleFactor])`
* `scaleFactor` Double (optional) - Defaults to 1.0.
Returns `Float` - The image's aspect ratio.
If `scaleFactor` is passed, this will return the aspect ratio corresponding to the image representation most closely matching the passed value.
#### `image.getScaleFactors()`
Returns `Float[]` - An array of all scale factors corresponding to representations for a given nativeImage.
#### `image.addRepresentation(options)`
* `options` Object