diff options
author | Frederik Fix <ich@derfred.com> | 2022-09-07 13:26:10 +0200 |
---|---|---|
committer | Frederik Fix <ich@derfred.com> | 2022-09-07 13:26:10 +0200 |
commit | edc7520e273fa1b2cbd0abac6a9fe2c1bd2680d5 (patch) | |
tree | 66bb861807d9715909205c2d4ccb89245cbaa87c /docs/API.md | |
parent | 2f1e11b54aa88cb24400fe93b64cec8024c919ab (diff) | |
download | novnc-edc7520e273fa1b2cbd0abac6a9fe2c1bd2680d5.tar.gz |
access to raw image data
Diffstat (limited to 'docs/API.md')
-rw-r--r-- | docs/API.md | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/docs/API.md b/docs/API.md index 5aaee7a..77e9056 100644 --- a/docs/API.md +++ b/docs/API.md @@ -155,6 +155,15 @@ protocol stream. [`RFB.clipboardPasteFrom()`](#rfbclipboardpastefrom) - Send clipboard contents to server. +[`RFB.getImageData()`](#rfbgetimagedata) + - Return the current content of the screen as an ImageData array. + +[`RFB.toDataURL()`](#rfbtodataurl) + - Return the current content of the screen as data-url encoded image file. + +[`RFB.toBlob()`](#rfbtoblob) + - Return the current content of the screen as Blob encoded image file. + ### Details #### RFB() @@ -423,3 +432,55 @@ to the remote server. **`text`** - A `DOMString` specifying the clipboard data to send. + +#### RFB.getImageData() + +The `RFB.getImageData()` method is used to return the current content of the +screen encoded as [`ImageData`](https://developer.mozilla.org/en-US/docs/Web/API/ImageData). + +##### Syntax + + RFB.getImageData(); + +#### RFB.toDataURL() + +The `RFB.toDataURL()` method is used to return the current content of the +screen encoded as a data URL that could for example be put in the `src` attribute +of an `img` tag. + +##### Syntax + + RFB.toDataURL(); + RFB.toDataURL(type); + RFB.toDataURL(type, encoderOptions); + +###### Parameters + +**`type`** *Optional* + - A string indicating the requested MIME type of the image + +**`encoderOptions`** *Optional* + - A number between 0 and 1 indicating the image quality. + +#### RFB.toBlob() + +The `RFB.toBlob()` method is used to return the current content of the +screen encoded as [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob). + +##### Syntax + + RFB.toDataURL(callback); + RFB.toDataURL(callback, type); + RFB.toDataURL(callback, type, quality); + +###### Parameters + +**`callback`** + - A callback function which will receive the resulting [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) + as the single argument + +**`type`** *Optional* + - A string indicating the requested MIME type of the image + +**`encoderOptions`** *Optional* + - A number between 0 and 1 indicating the image quality. |