snapshot([format], [crop])
Class: Panel. 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 |
|---|---|---|---|
|
|
string |
"png" |
Image format: |
|
|
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
