Metadata-Version: 2.1
Name: bshot
Version: 1.0.1
Summary: Python package to take screenshots of windows that are in background
Home-page: https://github.com/sandbox-pokhara/bshot
Author: Pradish Bijukchhe
Author-email: pradishbijukchhe@gmail.com
Project-URL: Bug Tracker, https://github.com/sandbox-pokhara/bshot/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Microsoft :: Windows
Requires-Python: >=3
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: pywin32

# bshot

Python package to take screenshots of windows that are in background

## Installation

```
pip install bshot
```

## Usage

```python
import cv2
import win32gui

from bshot.screenshot import get_image

hwnd = win32gui.FindWindow(None, "Untitled - Notepad")
img = get_image(hwnd)
cv2.imshow("bshot", img)
cv2.waitKey(0)
```

## Benchmark

The speed of the capture depends on the size of the window that is being captured.
It can caputre 220x160 window with 2400+ fps.

```python
import time

import win32gui

from bshot.screenshot import get_image

hwnd = win32gui.FindWindow(None, "Untitled - Notepad")

start = time.time()
count = 0
while time.time() - start < 1:
    get_image(hwnd)
    count += 1
print("fps =", count)
```

## Limitations

- The screenshot module uses GetClientRect which can crop some portion of the window contents.
