Merge pull request #5942 from enlight/patch-2

Fix location of code snippet in nativeImage docs
This commit is contained in:
Kevin Sawicki 2016-06-08 09:36:42 -07:00
commit e4398dde42

View file

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