Skip to content

Commit

Permalink
Python Release 🎉
Browse files Browse the repository at this point in the history
	modified:   README.md
	modified:   windows-capture-python/Cargo.toml
	new file:   windows-capture-python/README.md
	modified:   windows-capture-python/pyproject.toml
  • Loading branch information
NiiightmareXD committed Nov 10, 2023
1 parent 9b85372 commit b32452c
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

**Windows Capture** is a highly efficient Rust and Python library that enables you to effortlessly capture the screen using the Graphics Capture API. 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 and easy-to-use screen capturing solution.

**Note** this README.md is for [Rust library](https://github.com/NiiightmareXD/windows-capture) Python library can be found [here](https://github.com/NiiightmareXD/windows-capture/tree/main/windows-capture-python)

## Features

- Only Updates The Frame When Required.
Expand Down Expand Up @@ -110,4 +112,4 @@ Contributions are welcome! If you find a bug or want to add new features to the

## License

This project is licensed under the [MIT License](LICENSE).
This project is licensed under the [MIT License](LICENSE).
2 changes: 1 addition & 1 deletion windows-capture-python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["NiiightmareXD"]
edition = "2021"
description = "Fastest Windows Screen Capture Library For Python 🔥"
documentation = "https://docs.rs/windows-capture"
readme = "../README.md"
readme = "README.md"
repository = "https://github.com/NiiightmareXD/windows-capture"
license = "MIT"
keywords = ["screen", "capture", "screenshot", "graphics", "windows"]
Expand Down
65 changes: 65 additions & 0 deletions windows-capture-python/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Windows Capture
![Crates.io](https://img.shields.io/crates/l/windows-capture) ![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/NiiightmareXD/windows-capture/rust.yml) ![Crates.io](https://img.shields.io/crates/v/windows-capture)

**Windows Capture** is a highly efficient Rust and Python library that enables you to effortlessly capture the screen using the Graphics Capture API. 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 and 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, CaptureControl

# Every Error From on_closed and on_frame_arrived Will End Up Here
capture = WindowsCapture(
capture_cursor=True,
draw_border=False,
monitor_index=0,
window_name=None,
)


# Called Every Time A New Frame Is Available
@capture.event
def on_frame_arrived(frame: Frame, capture_control: CaptureControl):
print("New Frame Arrived")

# Save The Frame As An Image To 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
# Will End After This Function Ends
@capture.on_closed
def on_closed():
print("Capture Session Closed")


capture.start()
```

## 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).
2 changes: 1 addition & 1 deletion windows-capture-python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "maturin"
name = "windows-capture"
version = "1.0.24"
description = "Fastest Windows Screen Capture Library For Python 🔥"
readme = "../README.md"
readme = "README.md"
requires-python = ">=3.9"
license = "MIT"
authors = [{ name = "NiiightmareXD" }]
Expand Down

0 comments on commit b32452c

Please sign in to comment.