From 8e2ae9b9e73953ded7ae9233fe2adb6a194f9053 Mon Sep 17 00:00:00 2001 From: Vadim Macagon Date: Wed, 8 Jun 2016 23:34:45 +0700 Subject: [PATCH] Fix location of code snippet in nativeImage docs The code snippet for `nativeImage.createFromPath` somehow ended up in the wrong section of the document, this PR moves it back where it belongs. --- docs/api/native-image.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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.