From 6d5fbe6be23ea6889be2c9bd14ce7a23c8660776 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Mar 2017 16:22:48 -0800 Subject: [PATCH] Document scale factor option --- docs/api/native-image.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/docs/api/native-image.md b/docs/api/native-image.md index cc910cbb8a9..0350f13bc90 100644 --- a/docs/api/native-image.md +++ b/docs/api/native-image.md @@ -165,7 +165,10 @@ Process: [Main](../glossary.md#main-process), [Renderer](../glossary.md#renderer The following methods are available on instances of the `NativeImage` class: -#### `image.toPNG()` +#### `image.toPNG([options])` + +* `options` Object (optional) + * `scaleFactor` Double (optional) - Defaults to 1.0. Returns `Buffer` - A [Buffer][buffer] that contains the image's `PNG` encoded data. @@ -175,16 +178,25 @@ Returns `Buffer` - A [Buffer][buffer] that contains the image's `PNG` encoded da Returns `Buffer` - A [Buffer][buffer] that contains the image's `JPEG` encoded data. -#### `image.toBitmap()` +#### `image.toBitmap([options])` + +* `options` Object (optional) + * `scaleFactor` Double (optional) - Defaults to 1.0. Returns `Buffer` - A [Buffer][buffer] that contains a copy of the image's raw bitmap pixel data. -#### `image.toDataURL()` +#### `image.toDataURL([options])` + +* `options` Object (optional) + * `scaleFactor` Double (optional) - Defaults to 1.0. Returns `String` - The data URL of the image. -#### `image.getBitmap()` +#### `image.getBitmap([options])` + +* `options` Object (optional) + * `scaleFactor` Double (optional) - Defaults to 1.0. Returns `Buffer` - A [Buffer][buffer] that contains the image's raw bitmap pixel data.