CapSoftware / scap

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

Crop Area Size Being Doubled #103

Open marcochessa opened 4 months ago

marcochessa commented 4 months ago

I am experiencing an issue where the captured area size is doubled compared to the specified area in the Options. Specifically, when I set the capture area to a width of 500 pixels and a height of 500 pixels, the resulting frames have a resolution of 1000x1000 pixels. Is this doubling of the captured area size expected behavior?

let options = Options {
    fps: 60,
    target: Some(display),
    show_cursor: true,
    show_highlight: true,
    excluded_targets: None,
    output_type: scap::frame::FrameType::BGRAFrame,
    output_resolution: scap::capturer::Resolution::Captured,
    crop_area: Some(Area {
        origin: Point { x: 0.0, y: 0.0 },
        size: Size {
            width: 500.0,
            height: 500.0,
        },
    }),
    ..Default::default()
};

Output:

Received BGRA frame 0 of width 1000 and height 1000 and time 0