# Windows Capture   [![Licence]][Licence URL] [![Build Status]][repository] [![Latest Version]][pypi.org]
[Licence]: https://img.shields.io/crates/l/windows-capture
[Licence URL]: https://github.com/NiiightmareXD/windows-capture/blob/main/windows-capture-python/LICENCE
[Build Status]: https://img.shields.io/github/actions/workflow/status/NiiightmareXD/windows-capture/rust.yml
[repository]: https://github.com/NiiightmareXD/windows-capture/tree/main/windows-capture-python
[Latest Version]: https://img.shields.io/pypi/v/windows-capture
[pypi.org]: https://pypi.org/project/windows-capture
**Windows Capture** is a highly efficient Rust and Python library that enables you to capture the screen using the Graphics Capture API effortlessly. This library allows you to easily capture the screen of your Windows-based computer and use it for various purposes, such as creating instructional videos, taking screenshots, or recording your gameplay. With its intuitive interface and robust functionality, Windows Capture is an excellent choice for anyone looking for a reliable, easy-to-use screen-capturing solution.
**Note** this README.md is for [Python library](https://github.com/NiiightmareXD/windows-capture/tree/main/windows-capture-python) Rust library can be found [here](https://github.com/NiiightmareXD/windows-capture)
## Features
- Only Updates The Frame When Required.
- High Performance.
- Easy To Use.
- Latest Screen Capturing API.
## Installation
Run this command
```
pip install windows-capture
```
## Usage
```python
from windows_capture import WindowsCapture, Frame, InternalCaptureControl
# Every Error From on_closed and on_frame_arrived Will End Up Here
capture = WindowsCapture(
cursor_capture=None,
draw_border=None,
monitor_index=None,
window_name=None,
)
# Called Every Time A New Frame Is Available
@capture.event
def on_frame_arrived(frame: Frame, capture_control: InternalCaptureControl):
print("New Frame Arrived")
# Save The Frame As An Image To The Specified Path
frame.save_as_image("image.png")
# Gracefully Stop The Capture Thread
capture_control.stop()
# Called When The Capture Item Closes Usually When The Window Closes, Capture
# Session Will End After This Function Ends
@capture.event
def on_closed():
print("Capture Session Closed")
capture.start()
```
## Benchmark
Windows Capture Is The Fastest Python Screen Capture Library
![Benchmark Showing Windows Capture Is The Fastest Python Screen Capture Library](https://github.com/NiiightmareXD/windows-capture/assets/90005793/444fa93e-5e27-48c8-8eb6-b9e21ab26452)
## Contributing
Contributions are welcome! If you find a bug or want to add new features to the library, please open an issue or submit a pull request.
## License
This project is licensed under the [MIT License](LICENSE).
Raw data
{
"_id": null,
"home_page": null,
"name": "windows-capture",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "screen, capture, screenshot, graphics, windows",
"author": "NiiightmareXD",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/2d/68/065edbee59fdcbf324a36c2d61919ca302b2a9674285c73eb3855752f3f0/windows_capture-1.4.2.tar.gz",
"platform": null,
"description": "# Windows Capture   [![Licence]][Licence URL] [![Build Status]][repository] [![Latest Version]][pypi.org]\r\n\r\n[Licence]: https://img.shields.io/crates/l/windows-capture\r\n[Licence URL]: https://github.com/NiiightmareXD/windows-capture/blob/main/windows-capture-python/LICENCE\r\n\r\n[Build Status]: https://img.shields.io/github/actions/workflow/status/NiiightmareXD/windows-capture/rust.yml\r\n[repository]: https://github.com/NiiightmareXD/windows-capture/tree/main/windows-capture-python\r\n\r\n[Latest Version]: https://img.shields.io/pypi/v/windows-capture\r\n[pypi.org]: https://pypi.org/project/windows-capture\r\n\r\n**Windows Capture** is a highly efficient Rust and Python library that enables you to capture the screen using the Graphics Capture API effortlessly. This library allows you to easily capture the screen of your Windows-based computer and use it for various purposes, such as creating instructional videos, taking screenshots, or recording your gameplay. With its intuitive interface and robust functionality, Windows Capture is an excellent choice for anyone looking for a reliable, easy-to-use screen-capturing solution.\r\n\r\n**Note** this README.md is for [Python library](https://github.com/NiiightmareXD/windows-capture/tree/main/windows-capture-python) Rust library can be found [here](https://github.com/NiiightmareXD/windows-capture) \r\n\r\n## Features\r\n\r\n- Only Updates The Frame When Required.\r\n- High Performance.\r\n- Easy To Use.\r\n- Latest Screen Capturing API.\r\n\r\n## Installation\r\n\r\nRun this command\r\n\r\n```\r\npip install windows-capture\r\n```\r\n\r\n## Usage\r\n\r\n```python\r\nfrom windows_capture import WindowsCapture, Frame, InternalCaptureControl\r\n\r\n# Every Error From on_closed and on_frame_arrived Will End Up Here\r\ncapture = WindowsCapture(\r\n cursor_capture=None,\r\n draw_border=None,\r\n monitor_index=None,\r\n window_name=None,\r\n)\r\n\r\n\r\n# Called Every Time A New Frame Is Available\r\n@capture.event\r\ndef on_frame_arrived(frame: Frame, capture_control: InternalCaptureControl):\r\n print(\"New Frame Arrived\")\r\n\r\n # Save The Frame As An Image To The Specified Path\r\n frame.save_as_image(\"image.png\")\r\n\r\n # Gracefully Stop The Capture Thread\r\n capture_control.stop()\r\n\r\n\r\n# Called When The Capture Item Closes Usually When The Window Closes, Capture\r\n# Session Will End After This Function Ends\r\n@capture.event\r\ndef on_closed():\r\n print(\"Capture Session Closed\")\r\n\r\n\r\ncapture.start()\r\n```\r\n\r\n## Benchmark\r\n\r\nWindows Capture Is The Fastest Python Screen Capture Library\r\n\r\n![Benchmark Showing Windows Capture Is The Fastest Python Screen Capture Library](https://github.com/NiiightmareXD/windows-capture/assets/90005793/444fa93e-5e27-48c8-8eb6-b9e21ab26452)\r\n\r\n## Contributing\r\n\r\nContributions are welcome! If you find a bug or want to add new features to the library, please open an issue or submit a pull request.\r\n\r\n## License\r\n\r\nThis project is licensed under the [MIT License](LICENSE).\r\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Fastest Windows Screen Capture Library For Python \ud83d\udd25",
"version": "1.4.2",
"project_urls": {
"Source Code": "https://github.com/NiiightmareXD/windows-capture/tree/main/windows-capture-python"
},
"split_keywords": [
"screen",
" capture",
" screenshot",
" graphics",
" windows"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "fa0c2626a31baf675d1659f473bf39775a26c1bd159379512623d9e81d09fecf",
"md5": "fdd34986647139d92469bfe378271bcd",
"sha256": "5d89fff1f75c3345599893a2108972ea93a2721c48e70d76c0cf591825be8bf0"
},
"downloads": -1,
"filename": "windows_capture-1.4.2-cp39-abi3-win_amd64.whl",
"has_sig": false,
"md5_digest": "fdd34986647139d92469bfe378271bcd",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 207230,
"upload_time": "2024-11-14T10:12:50",
"upload_time_iso_8601": "2024-11-14T10:12:50.432365Z",
"url": "https://files.pythonhosted.org/packages/fa/0c/2626a31baf675d1659f473bf39775a26c1bd159379512623d9e81d09fecf/windows_capture-1.4.2-cp39-abi3-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "2d68065edbee59fdcbf324a36c2d61919ca302b2a9674285c73eb3855752f3f0",
"md5": "7afd654a9d43ecdb20b8328764db88e0",
"sha256": "d7a6840ad5e515c02ab657544e06ce5aeb8fe5598917e049ffeca1fe21140352"
},
"downloads": -1,
"filename": "windows_capture-1.4.2.tar.gz",
"has_sig": false,
"md5_digest": "7afd654a9d43ecdb20b8328764db88e0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 41027,
"upload_time": "2024-11-14T10:12:52",
"upload_time_iso_8601": "2024-11-14T10:12:52.889936Z",
"url": "https://files.pythonhosted.org/packages/2d/68/065edbee59fdcbf324a36c2d61919ca302b2a9674285c73eb3855752f3f0/windows_capture-1.4.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-14 10:12:52",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "NiiightmareXD",
"github_project": "windows-capture",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "windows-capture"
}