ScreenClass
class provides methods to access screen content of a systems main display
class ScreenClassProperties
| Name | Type | Description |
|---|---|---|
config | ScreenConfig | Config object for class(default: ...) |
Methods
capture
capture(fileName: string, fileFormat?: FileType, filePath?: string, fileNamePrefix?: string, fileNamePostfix?: string): Promise<string>captures a screenshot of a systems main display
Parameters
fileNamestringBasename for the generated screenshotfilePath?stringThe output path for the generated screenshot (Default: )fileNamePrefix?stringFilename prefix for the generated screenshot (Default: empty)fileNamePostfix?stringFilename postfix for the generated screenshot (Default: empty)Returns
Promise<string>colorAt
colorAt(point: Point | Promise<Point>): Promise<RGBA>returns RGBA color values for a certain pixel at p
Returns
Promise<RGBA>discardRecording
discardRecording(): Promise<void>discards the current screen recording without saving.
Returns
Promise<void>find
find(searchInput: RegionResultFindInput | Promise<RegionResultFindInput>, params?: OptionalSearchParameters<PROVIDER_DATA_TYPE>): Promise<Region>will search for a single occurrence of a given search input on a systems main screen
Parameters
params?OptionalSearchParameters<PROVIDER_DATA_TYPE>which are used to fine tune search region and / or match confidenceReturns
Promise<Region>findAll
findAll(searchInput: RegionResultFindInput | Promise<RegionResultFindInput>, params?: OptionalSearchParameters<PROVIDER_DATA_TYPE>): Promise<Region[]>will search for every occurrence of a given search input on a systems main screen
Parameters
params?OptionalSearchParameters<PROVIDER_DATA_TYPE>which are used to fine tune search region and / or match confidenceReturns
Promise<Region[]>height
height(): Promise<number>returns the main screen height
This refers to the hardware resolution.
Screens with higher pixel density (e.g. retina displays in MacBooks) might have a higher height in in actual pixels
Returns
Promise<number>highlight
highlight(regionToHighlight: Region | Promise<Region>): Promise<Region>highlights a screen for a certain duration by overlaying it with an opaque highlight window
Returns
Promise<Region>on
on(searchInput: object, callback: WindowCallback): voidregisters a callback which is triggered once a certain searchInput image is found
Parameters
searchInputobjectto trigger the callback onstartRecording
startRecording(options?: RECORDING_OPTIONS): Promise<void>starts screen recording.
Parameters
options?RECORDING_OPTIONSReturns
Promise<void>startStreaming
startStreaming(options?: STREAMING_OPTIONS): Promise<void>starts screen streaming.
Parameters
options?STREAMING_OPTIONSReturns
Promise<void>stopRecording
stopRecording(options?: STOP_RECORDING_OPTIONS): Promise<void>stops screen recording.
Parameters
options?STOP_RECORDING_OPTIONSReturns
Promise<void>stopStreaming
stopStreaming(options?: STOP_STREAMING_OPTIONS): Promise<void>stops screen streaming.
Parameters
options?STOP_STREAMING_OPTIONSReturns
Promise<void>waitFor
waitFor(searchInput: RegionResultFindInput | Promise<RegionResultFindInput>, timeoutMs?: number, updateInterval?: number, params?: OptionalSearchParameters<PROVIDER_DATA_TYPE>): Promise<Region>searches for a template image for a specified duration
Parameters
searchInputRegionResultFindInput | Promise<RegionResultFindInput>Filename of the template image, relative to , or antimeoutMs?numberTimeout in milliseconds after which failsupdateInterval?numberUpdate interval in milliseconds to retry searchparams?OptionalSearchParameters<PROVIDER_DATA_TYPE>which are used to fine tune search region and / or match confidenceReturns
Promise<Region>width
width(): Promise<number>returns the main screen width
This refers to the hardware resolution.
Screens with higher pixel density (e.g. retina displays in MacBooks) might have a higher width in in actual pixels
Returns
Promise<number>Was this page helpful?