docs: Update NativeImage
This commit is contained in:
parent
c8738a88a4
commit
06d681c66a
1 changed files with 22 additions and 14 deletions
|
@ -82,19 +82,7 @@ To mark an image as template image, its filename should end with the word
|
|||
|
||||
## nativeImage.createEmpty()
|
||||
|
||||
Creates a new `NativeImage` instance that contains empty image.
|
||||
|
||||
## nativeImage.createFromPng(buffer)
|
||||
|
||||
* `buffer` [Buffer][buffer]
|
||||
|
||||
Creates a new `NativeImage` instance from `buffer` with `PNG` format.
|
||||
|
||||
## nativeImage.createFromPng(buffer)
|
||||
|
||||
* `buffer` [Buffer][buffer]
|
||||
|
||||
Creates a new `NativeImage` instance from `buffer` with `JPEG` format.
|
||||
Creates an empty `NativeImage` instance.
|
||||
|
||||
## nativeImage.createFromPath(path)
|
||||
|
||||
|
@ -102,6 +90,20 @@ Creates a new `NativeImage` instance from `buffer` with `JPEG` format.
|
|||
|
||||
Creates a new `NativeImage` instance from file located at `path`.
|
||||
|
||||
## nativeImage.createFromBuffer(buffer[, scaleFactor])
|
||||
|
||||
* `buffer` [Buffer][buffer]
|
||||
* `scaleFactor` Double
|
||||
|
||||
Creates a new `NativeImage` instance from `buffer`. The `scaleFactor` is 1.0 by
|
||||
default.
|
||||
|
||||
## nativeImage.createFromDataUrl(dataUrl)
|
||||
|
||||
* `dataUrl` String
|
||||
|
||||
Creates a new `NativeImage` instance from `dataUrl`.
|
||||
|
||||
## Class: NativeImage
|
||||
|
||||
This class is used to represent an image.
|
||||
|
@ -110,10 +112,16 @@ This class is used to represent an image.
|
|||
|
||||
Returns a [Buffer][buffer] that contains image's `PNG` encoded data.
|
||||
|
||||
### NativeImage.isJpeg()
|
||||
### NativeImage.toJpeg(quality)
|
||||
|
||||
* `quality` Integer
|
||||
|
||||
Returns a [Buffer][buffer] that contains image's `JPEG` encoded data.
|
||||
|
||||
### NativeImage.toDataUrl()
|
||||
|
||||
Returns the data URL of image.
|
||||
|
||||
### NativeImage.isEmpty()
|
||||
|
||||
Returns whether the image is empty.
|
||||
|
|
Loading…
Reference in a new issue