modelflat / zbl

real-time window capture library based on D3D11 and Windows.Graphics.Capture
MIT License
14 stars 3 forks source link

How do I capture the whole screen? #1

Closed yanxiangrong closed 1 year ago

modelflat commented 1 year ago

Hi @yanxiangrong ! At the moment this is not supported, but I have plans for implementing it. However I don't have much spare time on my hands at the moment, thus can't give any definite timeline for this feature.

If you need it ASAP, you can implement it yourself. For directions, you can take a look at screenshot-rs which has support for taking whole display screenshots. Porting it to zbl should be a matter of introducing a Capturable trait, and making Window and Display implement it; then updating python bindings to accommodate for the change in rust code.

modelflat commented 1 year ago

@yanxiangrong actually, I've taken some time to implement it today, and it seems to work. Feel free to check it out in version 0.1.0!

modelflat commented 1 year ago

alright, so I finalized implementation and fixed a couple of bugs related to monitor scaling. This functionality is out with v0.1.1. Use python -m zbl --display-id 0 or with Capture(display_id=0) as capture: ... to capture the entire screen. Same is available in Rust interface.