WindowByDisplayUi

class WindowByDisplayUi(window: Window)[source]

Bases: BaseUi

Represent a window as a display-captured UI context. Unlike the WindowUi class, it retrieves the application’s image based on its borders rather than from the graphical shell.

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

Convert window 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 window 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 window from the display.

Returns:

Window screenshot data captured by window bounds.

Return type:

numpy.ndarray

property window: Window

Return the wrapped window instance.

Returns:

Wrapped window.

Return type:

Window