diff --git a/docs/api/native-image.md b/docs/api/native-image.md index 5244b71dfb1..d61f57ee4b9 100644 --- a/docs/api/native-image.md +++ b/docs/api/native-image.md @@ -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.