S or /

Module talon.screen

from talon import screen

Classes

NameReference
Screendepth · scale · dpi · dpi_x · dpi_y · manufacturer · model · name · serial · mm_x · mm_y · refresh_rate · main · rect · visible_rect · fingerprint · x · y · width · height · contains
ScreenFingerprintmanufacturer · model · name · serial · from_left · from_top · from_right · from_bottom · depth · scale · dpi · dpi_x · dpi_y · refresh_rate · main · rect · from_screen · pack · unpack · compare

Functions

NameReference
main()
screens() -> collections.abc.Sequence[talon.screen.Screen]
containing(x: float, y: float) -> Screen
nearest(x: float, y: float) -> Screen
register(topic: Any, cb: collections.abc.Callable) -> None
unregister(topic: Any, cb: collections.abc.Callable) -> None
capture(x: float, y: float, width: float, height: float, retina: bool = True) -> skia.Image
capture_rect(rect: Rect, retina: bool = True) -> Image
get_pixel(x: float, y: float) -> Color

Functions

main§

def main()

Example

from talon import screen

display = screen.main()
print(display.rect)

screens§

def screens() -> collections.abc.Sequence[talon.screen.Screen]

Example

from talon import screen

for display in screen.screens():
    print(display.name, display.rect, display.scale)

containing§

def containing(x: float, y: float) -> talon.screen.Screen

nearest§

def nearest(x: float, y: float) -> talon.screen.Screen

register§

def register(topic: Any, cb: collections.abc.Callable) -> None

unregister§

def unregister(topic: Any, cb: collections.abc.Callable) -> None

capture§

def capture(x: float, y: float, width: float, height: float, retina: bool = True) -> skia.Image

capture_rect§

def capture_rect(rect: skia.Rect, retina: bool = True) -> skia.Image

Example

from talon import screen

image = screen.capture_rect(screen.main().rect)

get_pixel§

def get_pixel(x: float, y: float) -> skia.Color

Further reading