From: Lucidogen Media Date: Sat, 6 Jun 2015 11:20:47 +0000 (+0200) Subject: Fixed example with correct capturePage api. X-Git-Tag: v0.28.0~27^2~1 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=9a0a10e76679f55e5197a41c15ecce665bc3a865;p=electron.git Fixed example with correct capturePage api. --- diff --git a/docs/api/remote.md b/docs/api/remote.md index 345b0d5b..70703743 100644 --- a/docs/api/remote.md +++ b/docs/api/remote.md @@ -97,7 +97,8 @@ returns a `Buffer` by calling the passed callback: ```javascript var remote = require('remote'); var fs = require('fs'); -remote.getCurrentWindow().capturePage(function(buf) { +remote.getCurrentWindow().capturePage(function(image) { + var buf = image.toPng() fs.writeFile('/tmp/screenshot.png', buf, function(err) { console.log(err); }); @@ -115,7 +116,8 @@ The work-around is to write the `buf` in the main process, where it is a real ```javascript var remote = require('remote'); -remote.getCurrentWindow().capturePage(function(buf) { +remote.getCurrentWindow().capturePage(function(image) { + var buf = image.toPng() remote.require('fs').writeFile('/tmp/screenshot.png', buf, function(err) { console.log(err); });