# Работа с экраном

## Код:

```python
x, y = screen.size # Получаем актуальное разрешение экрана
hz = screen.hz # Получаем частоту обновления монитора
x1,y1,x2,y2 = 0, 0, 100, 100
img = screen.capture(x1,y1,x2,y2) # Захватываем экран
"""Мы получаем изображение - массив пикселей. Вы можете делать что угодно."""
print(img.sum()) #сумма всех пикселей
print(img[0]) # Первый пиксель: (255, 124, 244) (R,G,B), получите его цвет
```

{% hint style="info" %}
Пиксельные триггер боты работаю либо на определённый цвет, либо на разность суммы пикселей предыдущего и текущего кадра.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.neuralaim.ru/napi/programmy-or-primery/rabota-s-ekranom.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
