Пример #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);
        }
        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
 /// <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();
 }