screen — autopy module for working with the screen

This module contains functions for working with the screen.


autopy.screen.scale() → float

Returns the scale of the main screen, i.e. how many pixels are in a point.

autopy.screen.size() -> (float, float)

Returns a tuple (width, height) of the size of the main screen in points.

autopy.screen.is_point_visible(x: float, y: float) → bool

Returns True if the given point is inside the main screen boundaries.

autopy.screen.get_color(x: float, y: float) -> (int, int, int)

Returns hexadecimal value describing the color at a given point.

Functionally equivalent to:

rect = ((x, y), (1, 1))
bitmap.capture_screen_portion(rect).get_color(0, 0)

only more efficient/convenient.

  • ValueError is thrown if the point out of bounds.