Browse Source

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

Shelley Vohr 4 years ago
parent
commit
21a6062a31
1 changed files with 15 additions and 3 deletions
  1. 15 3
      docs/api/native-image.md

+ 15 - 3
docs/api/native-image.md

@@ -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