コード例 #1
0
 // Cancel the focus if the half button press is released using the hardware shutter button.
 private void OnButtonRelease(object sender, EventArgs e)
 {
     if (cam != null)
     {
         cam.CancelFocus();
     }
 }
コード例 #2
0
        private void UninitializeCamera()
        {
            StopAutofocusTimer();
            StopScanning();

            if (_phoneCamera != null)
            {
                // Cleanup
                _phoneCamera.Initialized            -= CameraInitialized;
                CameraButtons.ShutterKeyHalfPressed -= CameraButtons_ShutterKeyHalfPressed;
                _phoneCamera.CancelFocus();
                _phoneCamera.Dispose();
                _phoneCamera = null;
            }

            if (_autofocusTimer != null)
            {
                _autofocusTimer = null;
            }

            if (_scanTimer != null)
            {
                _scanTimer = null;
            }

            if (_previewBuffer != null)
            {
                _previewBuffer = null;
            }

            if (_barcodeReader != null)
            {
                _barcodeReader = null;
            }
        }
コード例 #3
0
        protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e)
        {
            _cam.CancelFocus();
            _cam.Dispose();

            base.OnNavigatingFrom(e);
        }
コード例 #4
0
        protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e)
        {
            if (_photoCamera != null)
            {
                _timer.Stop();
                _photoCamera.CancelFocus();
                _photoCamera.Dispose();
            }

            base.OnNavigatingFrom(e);
        }
コード例 #5
0
 private void _focusButton_Click(object sender, RoutedEventArgs e)
 {
     if (_photoCamera != null && _photoCamera.IsFocusSupported)
     {
         try
         {
             _photoCamera.CancelFocus();
             _photoCamera.Focus();
         }
         catch
         {
         }
     }
 }
コード例 #6
0
        protected override void OnNavigatedFrom(NavigationEventArgs e)
        {
            base.OnNavigatedFrom(e);
            if ((Application.Current.RootVisual as PhoneApplicationFrame) != null)
            {
                (Application.Current.RootVisual as PhoneApplicationFrame).RemoveBackEntry();
            }

            if (_photoCamera != null)
            {
                _timer.Stop();
                _photoCamera.CancelFocus();
                _photoCamera.Dispose();
            }
        }
コード例 #7
0
ファイル: CameraService.wpsl.cs プロジェクト: wqhenry/Catel
 /// <summary>
 /// Cancels the current camera auto focus operation.
 /// </summary>
 /// <remarks>
 /// This method is already protected and only called when the service is currently running.
 /// </remarks>
 protected override void CancelCameraFocus()
 {
     _photoCamera.CancelFocus();
 }
コード例 #8
0
 /// <summary>
 /// Cancels the current focus operation.
 /// </summary>
 public void CancelFocus()
 {
     _photoCamera.CancelFocus();
 }