void StartSerialSyncCapture() { _fpsStopWatch = Stopwatch.StartNew(); SerialManager.SerialAcknowledged += OnSerialAcknowledged; MatrixFrame.InjestGDIBitmap(ScreenRecorder.ScreenToBitmap(), ScreenRecorder.InterpMode); // Dispatcher.Invoke(() => { FrameToPreview(); }); SerialManager.PushFrame(); }
void OnSerialAcknowledged() { if (SyncSerial == true) { MatrixFrame.InjestGDIBitmap(ScreenRecorder.ScreenToBitmap(), ScreenRecorder.InterpMode); // Dispatcher.Invoke(() => { FrameToPreview(); }); SerialManager.PushFrame(); LocalFPS = SerialFPS = _fpsStopWatch.ElapsedMilliseconds - _localPreviousMillis; _localPreviousMillis = _fpsStopWatch.ElapsedMilliseconds; } }