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).

Home Page:https://docs.rs/xcap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

scale_factor 值获取有误

lopo12123 opened this issue · comments

commented

以下是我的电脑的设置
image

我发现我用这个库获取屏幕列表信息的时候的 scale_factor 仍然是 1.

以下是我使用 fltk-rs 和 此库 分别获取屏幕 xywhscale_factor 的值的测试代码和对应输出
image
image

我这个是和electron的对齐的

I have the same issue.

My screen has the scale factor set to 1.25, but this library gets just 1.

I need this value to make some calculations, but cannot get the correct value of the screens.

I tried from Electron using Node-API and from Tauri, but I have the exact same issue in both.

Also, the resolution / size of the screenshots doesn't match with the resolution of the screen.

确认这个bug,再加上3840x2160 w/150%缩放会出现已经获取了display_info: 2560x1440 + 0.6666 scale_factor,再加上fn capture_screen_area里面还乘了一次,然后就获得了原分辨率÷1.5*0.666的一张1706x960的左上角50%不到的局部截图。。。

确认这个bug,再加上3840x2160 w/150%缩放会出现已经获取了display_info: 2560x1440 + 0.6666 scale_factor,再加上fn capture_screen_area里面还乘了一次,然后就获得了原分辨率÷1.5*0.666的一张1706x960的左上角50%不到的局部截图。。。

这是一个错误,我已经在display-info中修复,更新一下lock文件即可

Mine seems to be fine? 4K screen, but I'm on Win11 though. "Screen { display_info: DisplayInfo { id: 2776250164, raw_handle: HMONITOR(161683325), x: 0, y: 0, width: 3072, height: 1728, rotation: 0.0, scale_factor: 1.25, frequency: 60.0, is_primary: true } }"