Module talon.screen
from talon import screenClasses
| Name | Reference |
|---|---|
Screen | depth · 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 |
ScreenFingerprint | manufacturer · 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
| Name | Reference |
|---|---|
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.Screennearest§
def nearest(x: float, y: float) -> talon.screen.Screenregister§
def register(topic: Any, cb: collections.abc.Callable) -> Noneunregister§
def unregister(topic: Any, cb: collections.abc.Callable) -> Nonecapture§
def capture(x: float, y: float, width: float, height: float, retina: bool = True) -> skia.Imagecapture_rect§
def capture_rect(rect: skia.Rect, retina: bool = True) -> skia.ImageExample
from talon import screen
image = screen.capture_rect(screen.main().rect)
get_pixel§
def get_pixel(x: float, y: float) -> skia.Color