DesktopUi

class DesktopUi(display_id: int = 0)[source]

Bases: BaseUi

Represent the full desktop as a UI context.

point_to_global(coordinates: Point | RelativelyPoint) Point[source]
point_to_global(coordinates: Point)
point_to_global(coordinates: RelativelyPoint)

Convert desktop coordinates to the global screen space.

Parameters:

coordinates (Point | RelativelyPoint) – Local or relative coordinates to convert.

Returns:

Converted global point.

Return type:

Point

point_to_local(coordinates: Point) Point[source]

Convert global coordinates to the desktop local space.

Parameters:

coordinates (Point) – Global point to convert.

Returns:

Converted local point.

Return type:

Point

get_screenshot() ndarray[source]

Capture a screenshot of the desktop.

Returns:

Desktop screenshot data.

Return type:

numpy.ndarray

property window: Window

Raise an exception because the desktop has no window.

Raises:

WindowActionWithDesktopException – Always raised for desktop UI contexts.