Capture API: Screen Capture
The Screen Capture API allows you to capture a screenshot of the current view of the screen and to save it locally as an image file. Parameters of the function let you define the filename used, whether to capture the entire screen or just a portion of it, and to trigger a callback once the capture has been saved successfully.
The screen capture function can be used in combination with an HTML5 canvas in your code to capture visitor signatures and/or drawings as shown in one of our demo samples.
Functions
Requirements
- Access JavaScript API
- By Import - recommended, works both online & offline, requires inclusion of kiosk_functions.js prior to any of the following calls.
- By Injection - only works offline, may not be available 'onload'.
Sample Code
This sample code relies on the JavaScript APIs built into Kiosk Pro and will not run successfully in other browsers or within our in-app help interface.
To run sample code, set the app's homepage to
http://www.kioskproapp.com/screencap
saveScreenToPng
This function triggers a screen capture and saves the result in the local Kiosk Pro documents folder.
Format | saveScreenToPng(filename, x-axis, y-axis, width, height, callback); |
Parameters |
|
Callback format | callback(success); |
Callback return values | success = if defined, the function successfully captured and saved an image to the Kiosk Pro document's folder. |