Merge pull request #5942 from enlight/patch-2
Fix location of code snippet in nativeImage docs
This commit is contained in:
commit
e4398dde42
1 changed files with 6 additions and 6 deletions
|
@ -103,6 +103,12 @@ Creates an empty `nativeImage` instance.
|
|||
|
||||
Creates a new `nativeImage` instance from a file located at `path`.
|
||||
|
||||
```javascript
|
||||
const nativeImage = require('electron').nativeImage;
|
||||
|
||||
let image = nativeImage.createFromPath('/Users/somebody/images/icon.png');
|
||||
```
|
||||
|
||||
### `nativeImage.createFromBuffer(buffer[, scaleFactor])`
|
||||
|
||||
* `buffer` [Buffer][buffer]
|
||||
|
@ -121,12 +127,6 @@ Creates a new `nativeImage` instance from `dataURL`.
|
|||
|
||||
The following methods are available on instances of `nativeImage`:
|
||||
|
||||
```javascript
|
||||
const nativeImage = require('electron').nativeImage;
|
||||
|
||||
let image = nativeImage.createFromPath('/Users/somebody/images/icon.png');
|
||||
```
|
||||
|
||||
### `image.toPng()`
|
||||
|
||||
Returns a [Buffer][buffer] that contains the image's `PNG` encoded data.
|
||||
|
|
Loading…
Reference in a new issue