CapSoftware / scap

High-performance, cross-platform screen capture library in Rust.
https://crates.io/crates/scap
Other
229 stars 44 forks source link

Crop area chops of bottom of capture window #121

Open BenedictWilkins opened 1 month ago

BenedictWilkins commented 1 month ago

The default crop area for windowed capture gets confused by the header bar of the window, it crops of the bottom pixels of the window rather than the window header, as you can see in the image below (I am working on a python binding for this library btw - its plotting the capture in matplotlib).

Screenshot 2024-09-24 175130

If I go in and remove the crop option (force set it to None in scap source - it doesn't work if I provide None to Options...) then it correctly captures the full window (including the header bar). The crop_area option is buggy basically - I can only speak for windows, but it seems like this may be an issue on other platforms, it is a common problem that the reported size of a window by the OS doesn't reflect the actual size of the window + the header bar, this may be the issue.

I am on windows 11 and using the latest github version of scap.

BenedictWilkins commented 1 month ago

NOTE: I have updated to use windows crate 0.58, this could be the source of the issue, see if you can reproduce!

EDIT: it could also be an output resolution thing, since it looks like the windows API call is correct...