takeVisualSnapshot method

Takes a screen capture of the current document.

Note  These APIs can only be used with F12 developer tools and the Diagnostics Script Engine, and can't be called from JavaScript.

 

 

Syntax

var bImage = DiagnosticsBrowser.takeVisualSnapshot(width, height, keepAspectRatio);

Parameters

  • width [in, optional]
    Type: number

    Width in pixels. Must not exceed 3000 pixels.

  • height [in, optional]
    Type: number

    Height in pixels. Must not exceed 3000 pixels.

  • keepAspectRatio [in, optional]
    Type: boolean

    If true the aspect ratio is respected, false it is ignored if width and height don't match.

Return value

Type: Blob

A base 64 encoded image.

Remarks

The largest image we can return is the size of the current document. If a larger size is requested, the current dimension values are used. If both the width and height are 0, the current document's actual size for the width and height are used. If only one of them is 0, the non-zero value is used for both the height and width.

See also

DiagnosticsBrowser