Example #1
0
        public async Task PreviewStart()
        {
            if (!cameraCapture.IsInitialized)
            {
                await cameraCapture.Initialize(captureElement);
            }

            if (!cameraCapture.IsPreviewActive)
            {
                await cameraCapture.Start();
            }

            IsPreviewActive = cameraCapture.IsPreviewActive;

            UpdateProcessing();
        }
Example #2
0
        private async void ButtonPreview_Click(object sender, RoutedEventArgs e)
        {
            await _cameraCapture.Initialize(CaptureElementPreview);

            await InitializeFaceDetection();

            if (_cameraCapture.IsInitialized)
            {
                await UpdatePreviewState();

                UpdateUi();
            }
            else
            {
                Debug.WriteLine("Video capture device could not be initialized");
            }
        }
Example #3
0
        private async Task UpdatePreviewState()
        {
            await cameraCapture.Initialize(CaptureElementPreview);

            if (cameraCapture.IsInitialized)
            {
                if (!cameraCapture.IsPreviewActive)
                {
                    await cameraCapture.Start();

                    BeginProcessing();
                }
                else
                {
                    await cameraCapture.Stop();
                }
            }
        }