Comments (5)
Ok... I have no idea what's happening 😂.
Maybe something is wrong with the DispatcherQueue I think I have to get help from robmikh/Win32CaptureSample .
from windows-capture.
from windows-capture.
So this works:
use std::thread::sleep;
use std::time::Duration;
use windows_capture::window::Window;
use windows_capture::{
capture::GraphicsCaptureApiHandler,
frame::Frame,
graphics_capture_api::InternalCaptureControl,
settings::{ColorFormat, CursorCaptureSettings, DrawBorderSettings, Settings},
};
struct Capture {}
impl GraphicsCaptureApiHandler for Capture {
type Flags = String;
type Error = Box<dyn std::error::Error + Send + Sync>;
fn new(message: Self::Flags) -> Result<Self, Self::Error> {
Ok(Self {})
}
fn on_frame_arrived(
&mut self,
frame: &mut Frame,
capture_control: InternalCaptureControl,
) -> Result<(), Self::Error> {
println!("Frame Arrived");
Ok(())
}
fn on_closed(&mut self) -> Result<(), Self::Error> {
println!("Capture Session Closed");
Ok(())
}
}
fn main() {
let window = Window::from_contains_name("Notepad").unwrap();
std::thread::spawn(move || {
let settings = Settings::new(
window,
CursorCaptureSettings::Default,
DrawBorderSettings::Default,
ColorFormat::Rgba8,
"Yea This Works".to_string(),
)
.unwrap();
Capture::start(settings).unwrap();
println!("capture closed");
});
loop {
sleep(Duration::from_secs(1));
}
}
from windows-capture.
Fixed in 1.1.8, thanks for reporting the bug 😁.
from windows-capture.
thanks
from windows-capture.
Related Issues (20)
- [FEATURE ⭐] ECAL support HOT 3
- [BUG 🪲] dosent work
- Border HOT 3
- ⭐ Cross-platform Support HOT 1
- [BUG 🪲] When the window is not maximized, the obtained image is incorrect. HOT 3
- [BUG 🪲] Python version returns error when trying to start a WindowsCapture HOT 1
- [BUG 🪲] Typo on `CursorCaptuerSettings`? HOT 1
- [BUG 🪲] Graphics Capture Error HOT 4
- How to Start Recording? I'm facing a lot of errors HOT 11
- [FEATURE ⭐] HOT 1
- [BUG 🪲] HOT 1
- [FEATURE ⭐] is there a way to get list of active tabs and user can select the specific tab to get screen recorder HOT 4
- [BUG 🪲] window capture getting pink color output in the recorded video HOT 9
- [BUG 🪲] Doesn't start recording HOT 1
- [FEATURE ⭐] Improved guide how to setup library HOT 4
- How do I pass a buffer from a callback function? HOT 3
- [BUG 🪲] Using `start_free_threaded` does not call `on_closed` HOT 2
- [BUG 🪲] ColorFormat::Rgba16F with FrameBuffer::as_raw_nopadding_buffer returns 4 u8 values per pixel HOT 1
- [FEATURE ⭐] Guide for single frame capture on demand HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from windows-capture.