private void cameraPropertyValueAuto_CheckedChanged(Object sender, EventArgs e) { if (CameraPropertyControlInitializationComplete) { CameraPropertyValue value = new CameraPropertyValue(IsCameraPropertyValueTypePercentage, CameraPropertyValue, IsCameraPropertyAuto); CurrentCamera.SetCameraProperty(SelectedCameraProperty, value); } }
private void UpdateCameraPropertyRange(CameraPropertyCapabilities propertyCapabilities) { String text; if (IsSelectedCameraPropertySupported && propertyCapabilities.IsGetRangeSupported && propertyCapabilities.IsGetSupported) { CameraPropertyRange range = CurrentCamera.GetCameraPropertyRange(SelectedCameraProperty); text = String.Format("[ {0}, {1} ], step: {2}", range.Minimum, range.Maximum, range.Step); Int32 decimalPlaces; Decimal minimum, maximum, increment; if (IsCameraPropertyValueTypeValue) { minimum = range.Minimum; maximum = range.Maximum; increment = range.Step; decimalPlaces = 0; } else if (IsCameraPropertyValueTypePercentage) { minimum = 0; maximum = 100; increment = 0.01M; decimalPlaces = 2; } else { throw new NotSupportedException(String.Format("Camera property value type '{0}' is not supported.", ( String )cameraPropertyValueTypeSelection.SelectedItem)); } cameraPropertyValueValue.Minimum = minimum; cameraPropertyValueValue.Maximum = maximum; cameraPropertyValueValue.Increment = increment; cameraPropertyValueValue.DecimalPlaces = decimalPlaces; if (CurrentCameraPropertyRanges.ContainsKey(SelectedCameraProperty)) { CurrentCameraPropertyRanges[SelectedCameraProperty] = range; } else { CurrentCameraPropertyRanges.Add(SelectedCameraProperty, range); } CameraPropertyValue value = CurrentCamera.GetCameraProperty(SelectedCameraProperty, IsCameraPropertyValueTypeValue); SuppressCameraPropertyValueValueChangedEvent = true; cameraPropertyValueValue.Value = value.Value; cameraPropertyValueAuto.Checked = value.IsAuto; SuppressCameraPropertyValueValueChangedEvent = false; } else { text = "N/A"; } cameraPropertyRangeValue.Text = text; }
private void cameraPropertyValueValue_EnabledChanged(Object sender, EventArgs e) { if (CameraPropertyControlInitializationComplete && !SuppressCameraPropertyValueValueChangedEvent && cameraPropertyValueValue.Enabled) { CameraPropertyValue value = CurrentCamera.GetCameraProperty(SelectedCameraProperty, IsCameraPropertyValueTypeValue); cameraPropertyValueValue.Value = value.Value; cameraPropertyValueAuto.Checked = value.IsAuto; } }
private void cameraPropertyValueAuto_CheckedChanged( Object sender, EventArgs e ) { if( CameraPropertyControlInitializationComplete ) { CameraPropertyValue value = new CameraPropertyValue( IsCameraPropertyValueTypePercentage, CameraPropertyValue, IsCameraPropertyAuto ); CurrentCamera.SetCameraProperty( SelectedCameraProperty, value ); } }