public void RecordBitmap(IntPtr pFrame) { lock (_lock) { if (_isCapturing) { var timestamp = (long)(DateTime.Now - _startTime).TotalMilliseconds * 10000; CppAssembly.WriteImageToFile(_cameraReaderPointer, timestamp, pFrame); } } }
private void Disconnect() { if (_cameraReaderPointer == IntPtr.Zero) { return; } lock (_lock) { CppAssembly.DisconnectFromCamera(_cameraReaderPointer); _isCapturing = false; } }
public void StopCaptureToFile() { if (!IsConnected()) { return; } lock (_lock) { if (!_isCapturing) { return; } CppAssembly.StopCaptureImageToFile(_cameraReaderPointer); _isCapturing = false; } }
public void ConfigureCaptureToFile(string path, CameraSetup setup) { Connect(); lock (_lock) { if (_isCapturing) { CppAssembly.StopCaptureImageToFile(_cameraReaderPointer); } CppAssembly.StartCaptureImageToFile(_cameraReaderPointer, path, (uint)setup.RGBWidth, (uint)setup.RGBHeight, (uint)setup.RGBFPS, out var invokeResult); _isCapturing = true; _startTime = DateTime.Now; if (invokeResult != 0) { throw new InvalidOperationException($"StartRecording Failed #{invokeResult}."); } } }
public int GetMFCppVersion() { return(CppAssembly.GetImplementationVersion()); }