// 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(); } }
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; } }
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); }
private void _focusButton_Click(object sender, RoutedEventArgs e) { if (_photoCamera != null && _photoCamera.IsFocusSupported) { try { _photoCamera.CancelFocus(); _photoCamera.Focus(); } catch { } } }
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(); } }
/// <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(); }
/// <summary> /// Cancels the current focus operation. /// </summary> public void CancelFocus() { _photoCamera.CancelFocus(); }