Skip to content

remove yellow border. #140

@1mZ1kk4d0

Description

@1mZ1kk4d0

I looked but couldn't find anything on how to remove this yellow border around the window.

`
use scap::{
capturer::{Capturer, Options, Resolution}, frame::{Frame, FrameType}, get_all_targets, Target
};
use opencv::{core::{get_cuda_enabled_device_count, GpuMat, GpuMatTrait, GpuMatTraitConst, Mat, MatTraitConst, Mat_AUTO_STEP, CV_8UC4}, highgui, imgproc::{self, cvt_color}};

fn main() -> Result<(), Box> {

let targets = get_all_targets();

let new_world_window = targets
.into_iter()
.find(|target| match target {
    Target::Window(window) => window.title == "New World",
    _ => false,
});

let options = Options {
    fps: 30,
    target: new_world_window,
    show_cursor: false,
    show_highlight: false,
    excluded_targets: None,
    output_type: FrameType::BGRAFrame,
    output_resolution: Resolution::_480p,
    crop_area: None,
    ..Default::default()
};

let mut capturer = Capturer::new(options);
capturer.start_capture();

highgui::named_window("Scap Preview", highgui::WINDOW_NORMAL)?;

loop {
    if let Ok(frame) = capturer.get_next_frame() {
        if let Frame::BGRA(bgra_frame) = frame {

            let data = bgra_frame.data.as_slice();
            let width = bgra_frame.width as i32;
            let height = bgra_frame.height as i32;

            
            let bgra_mat = Mat::from_slice(data)?;
            let bgra_mat = bgra_mat.reshape(4, height)?;

            
            let mut bgr_frame = Mat::default();
            imgproc::cvt_color(&bgra_mat, &mut bgr_frame, imgproc::COLOR_BGRA2BGR, 0)?;


            highgui::imshow("Scap Preview", &bgr_frame)?;

            
            if highgui::wait_key(1)? == 'q' as i32 {
                break;
            }
        }
    }
    
}

Ok(())

}
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions