rogerwang/node-webkit — pull request #1638 by FWeinb (2014-02-28 17:11:35+00:00)
Title: capturePage using NodeBuffer

This is my first attempt of implementing node buffers into the screenshot mechanism asked in Issue #480.

With this pull request I extended the capturePage API and provide legacy support.

The new signature is `capturePage(callback, [String || Object])`
String: `jpeg` or `png`
Object: `{ format : "[jpeg|png]", datatype : "[raw|buffer|datauri]" }`
Defaults are:
format: `jpeg`
datatype: `datauri`

Examples:
```js
// jpeg as datauri
win.capturePage(function(datauri){
// do something with the datauri
});

// png as datauri
win.capturePage(function(datauri){
// do something with the datauri
}, 'png');

// Extended API

// png as datauri
win.capturePage(function(datauri){
// do something with the datauri
}, { format : 'png' } );

// png as node buffer
win.capturePage(function(buffer){
// do something with the buffer
}, { format : 'png', datatype : 'buffer'} );

// png as base64string
win.capturePage(function(base64string){
// do something with the base64string
}, { format : 'png', datatype : 'raw'} );

```