/// <summary> /// The event handler for the <see cref="OnVideoProcAmpPropertyChanged"/> event. /// Updates the video capture device with new zoom, pan, etc. /// </summary> /// <param name="property">The <see cref="CameraControlProperty"/> to be changed</param> /// <param name="value">The new value for the property</param> private void OnCameraControlPropertyChanged(CameraControlProperty property, int value) { if (this.cameraControl == null) { return; } // Todo: Disabled focus as it turns on autofocus if (property.Equals(CameraControlProperty.Focus)) { return; } int min, max, steppingDelta, defaultValue; CameraControlFlags flags; try { this.cameraControl.GetRange(property, out min, out max, out steppingDelta, out defaultValue, out flags); if (value >= min && value <= max) { this.cameraControl.Set(property, value, flags); } } catch (Exception ex) { ErrorLogger.ProcessException(ex, false); } }
/// <summary> /// The event handler for the <see cref="OnVideoProcAmpPropertyChanged"/> event. /// Updates the video capture device with new zoom, pan, etc. /// </summary> /// <param name="property">The <see cref="CameraControlProperty"/> to be changed</param> /// <param name="value">The new value for the property</param> public void OnCameraControlPropertyChanged(CameraControlProperty property, int value) { Console.WriteLine("//ERV --- trying... ------- OnCameraControlPropertyChanged(" + property + "," + value); if (cameraControl == null) { return; } // Todo: Disabled focus as it turns on autofocus if (property.Equals(CameraControlProperty.Focus)) { return; } int min, max, steppingDelta, defaultValue; CameraControlFlags flags; try { cameraControl.GetRange(property, out min, out max, out steppingDelta, out defaultValue, out flags); if (value >= min && value <= max) { Console.WriteLine("//ERV --- set it! ------- OnCameraControlPropertyChanged(" + property + "," + value); cameraControl.Set(property, value, flags); } } catch (Exception ex) { Console.WriteLine("ERROR! " + ex.ToString()); MessageBox.Show(ex.Message); } }
/// <summary> /// The event handler for the <see cref="OnVideoProcAmpPropertyChanged"/> event. /// Updates the video capture device with new zoom, pan, etc. /// </summary> /// <param name="property">The <see cref="CameraControlProperty"/> to be changed</param> /// <param name="value">The new value for the property</param> public void OnCameraControlPropertyChanged(CameraControlProperty property, int value) { if (cameraControl == null) return; // Todo: Disabled focus as it turns on autofocus if (property.Equals(CameraControlProperty.Focus)) { return; } int min, max, steppingDelta, defaultValue; CameraControlFlags flags; try { cameraControl.GetRange(property, out min, out max, out steppingDelta, out defaultValue, out flags); if (value >= min && value <= max) cameraControl.Set(property, value, flags); } catch (Exception) { //ErrorLogger.ProcessException(ex, false); } }