mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Merge pull request #5942 from enlight/patch-2
Fix location of code snippet in nativeImage docs
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user