Displays
5.21.0Glue42 Enterprise provides a way for applications to programmatically capture screenshots of the available monitors, of windows and window groups. Based on custom logic you can capture one or all monitors in order to save a snapshot of the visual state at a given moment.
The Displays API is accessible through the glue.displays
object.
APIobject
Description
Displays API
Available since version Glue42 Enteprise 3.9Methods
allmethod
capturemethod
Signature
(options: CaptureOptions) => Promise<string>
Description
Returns a base64
string of the screenshot of a single display.
Parameters
Name | Type | Required | Description |
---|---|---|---|
options | CaptureOptions | Options object specifying the ID of the display to capture and the size of the returned image. |
captureAllmethod
Signature
(options: CaptureAllOptions) => Promise<string | string[]>
Description
Returns a base64
string of the screenshots of all displays. The returned value depends on the combined
property specified in the options object.
Parameters
Name | Type | Required | Description |
---|---|---|---|
options | CaptureAllOptions | Options object specifying the way the captured screenshots should be returned. |
getmethod
Signature
(id: number) => Promise<Display>
Description
Returns a single display by ID.
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | number | ID of the desired display. |
getByWindowIdmethod
Signature
(id: string) => Promise<Display>
Description
Returns a single display by window ID.
Available since version 3.12
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Window ID of the desired display. |
getMousePositionmethod
getPrimarymethod
AbsoluteSizeOptionsobject
Description
Absolute size of the returned image.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
height | number | Height of the returned image. |
||
keepAspectRatio | boolean | Specifies whether to keep the aspect ratio of the output image when you specify |
||
width | number | Width of the returned image. |
Boundsobject
Description
Object describing the bounds of the display.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
height | number | The height of the display (integer). |
||
left | number | The horizontal coordinate of the top left corner of the display (integer). |
||
top | number | The vertical coordinate of the top left corner of the display (integer). |
||
width | number | The width of the display (integer). |
CaptureAllOptionsobject
Description
Options for capturing all displays.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
combined | boolean | Specifies whether to return a single image (if |
||
size | AbsoluteSizeOptions | ScaleOptions | Accepts either a |
CaptureOptionsobject
Description
Options for capturing a single display.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
id | number | A |
||
size | AbsoluteSizeOptions | ScaleOptions | Accepts either a |
Displayobject
Description
Object describing a display.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
aspectRatio | string | Aspect ratio of the display (e.g., 16:9). |
||
bounds | Bounds | Bounds of the display (width, height, left and top coordinates) |
||
capture | (size: AbsoluteSizeOptions | ScaleOptions) => Promise<string> | Captures a screenshot of the current display. |
||
dpi | number | Display resolution. |
||
id | number | Unique identifier associated with the display. |
||
index | number | Index assigned to the display by the operating system. |
||
isPrimary | boolean | Whether this is the primary display. |
||
name | string | Name assigned to the display by the operating system. |
||
scaleFactor | number | The scale factor of the returned display. |
||
workArea | Bounds | The working area of the display. |
Pointobject
Description
Coordinates of a point on the screen.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
x | number | The X coordinate of the point. |
||
y | number | The Y coordinate of the point. |
ScaleOptionsobject
Description
Relative size of the returned image.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
scale | number | Specifies the size of the output image relative to the actual screen size. |