nashaofu / xcap

XCap is a cross-platform screen capture library written in Rust. It supports Linux (X11, Wayland), MacOS, and Windows. XCap supports screenshot and video recording (to be implemented).
https://docs.rs/xcap
Apache License 2.0
459 stars 55 forks source link

Windows11 获取窗口位置和窗口大小错误 #143

Open ningnao opened 4 weeks ago

ningnao commented 4 weeks ago

屏幕分辨率 1920*1080 缩放 125% 最大化窗口

Window: "Windows 资源管理器" "rust" (-9, -9, 1938, 1038) (false, true)

截出来的图四周也有9个像素的黑边

看起来是因为将窗口阴影也计算在其中了 https://learn.microsoft.com/zh-cn/windows/win32/api/winuser/nf-winuser-getwindowrect

nashaofu commented 3 weeks ago

升级最新版本试试

ningnao commented 3 weeks ago

资源管理器、任务管理器 y轴坐标 和 高度 仍然不准确

Window: "" "任务管理器" (0, -9, 1920, 1029) (false, true)
Window: "Windows 资源管理器" "test" (0, -9, 1920, 1029) (false, true)