-
-
Notifications
You must be signed in to change notification settings - Fork 92
Open
Description
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
Labels
No labels