snapshot([format], [crop])

Class: Window. Method inherited from UIComponent.

Description:

Captures an image of the component and all subcomponents. Returns the image as a base 64 encoded string in format "data:image/FORMAT;base64,As8fE4fdt1r.....".

Parameters:

Name Type Default Description

[format]

string

"png"

Image format: png, jpg, jpeg, bmp, gif.

[crop]

Object

null

Object that holds position and size of the cropped area. Format: {x: number, y: number, width: number, height: number}.

Returns:

Returns base 64 encoded string representation of the image. To get its binary data you must extract the base 64 string, then decode it from base 64 to bytes.

Type: string