Esempio n. 1
0
 public void RecordBitmap(IntPtr pFrame)
 {
     lock (_lock)
     {
         if (_isCapturing)
         {
             var timestamp = (long)(DateTime.Now - _startTime).TotalMilliseconds * 10000;
             CppAssembly.WriteImageToFile(_cameraReaderPointer, timestamp, pFrame);
         }
     }
 }
Esempio n. 2
0
        private void Disconnect()
        {
            if (_cameraReaderPointer == IntPtr.Zero)
            {
                return;
            }

            lock (_lock)
            {
                CppAssembly.DisconnectFromCamera(_cameraReaderPointer);
                _isCapturing = false;
            }
        }
Esempio n. 3
0
 public void StopCaptureToFile()
 {
     if (!IsConnected())
     {
         return;
     }
     lock (_lock)
     {
         if (!_isCapturing)
         {
             return;
         }
         CppAssembly.StopCaptureImageToFile(_cameraReaderPointer);
         _isCapturing = false;
     }
 }
Esempio n. 4
0
        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}.");
                }
            }
        }
Esempio n. 5
0
 public int GetMFCppVersion()
 {
     return(CppAssembly.GetImplementationVersion());
 }