コード例 #1
0
		/// <summary>
		/// Sets the temperature and tint.
		/// </summary>
		void SetTemperatureAndTint() {
			// Grab current temp and tint
			var TempAndTint = new AVCaptureWhiteBalanceTemperatureAndTintValues (Temperature.Value, Tint.Value);

			// Convert Color space
			var gains = ThisApp.CaptureDevice.GetDeviceWhiteBalanceGains (TempAndTint);

			// Set the new values
			if (ThisApp.CaptureDevice.LockForConfiguration (out Error)) {
				gains = NomralizeGains (gains);
				ThisApp.CaptureDevice.SetWhiteBalanceModeLockedWithDeviceWhiteBalanceGains (gains, null);
				ThisApp.CaptureDevice.UnlockForConfiguration ();
			}
		}
コード例 #2
0
		/// <summary>
		/// Sets the temperature and tint.
		/// </summary>
		private void SetTemperatureAndTint() {
			// Grab current temp and tint
			// NOTE: The following line explodes in Xamarin with no error being thrown...
			AVCaptureWhiteBalanceTemperatureAndTintValues TempAndTint = new AVCaptureWhiteBalanceTemperatureAndTintValues(Temperature.Value, Tint.Value);

			// Convert Color space
			var gains = ThisApp.CaptureDevice.GetDeviceWhiteBalanceGains (TempAndTint);

			// Set the new values
			ThisApp.CaptureDevice.LockForConfiguration(out Error);
			ThisApp.CaptureDevice.SetWhiteBalanceModeLockedWithDeviceWhiteBalanceGains (gains, (time) => {
				// Ignore callback for now
			});
			ThisApp.CaptureDevice.UnlockForConfiguration();
		}
コード例 #3
0
        /// <summary>
        /// Sets the temperature and tint.
        /// </summary>
        void SetTemperatureAndTint()
        {
            // Grab current temp and tint
            var TempAndTint = new AVCaptureWhiteBalanceTemperatureAndTintValues(Temperature.Value, Tint.Value);

            // Convert Color space
            var gains = ThisApp.CaptureDevice.GetDeviceWhiteBalanceGains(TempAndTint);

            // Set the new values
            if (ThisApp.CaptureDevice.LockForConfiguration(out Error))
            {
                gains = NomralizeGains(gains);
                ThisApp.CaptureDevice.SetWhiteBalanceModeLockedWithDeviceWhiteBalanceGains(gains, null);
                ThisApp.CaptureDevice.UnlockForConfiguration();
            }
        }
コード例 #4
0
        /// <summary>
        /// Sets the temperature and tint.
        /// </summary>
        private void SetTemperatureAndTint()
        {
            // Grab current temp and tint
            // NOTE: The following line explodes in Xamarin with no error being thrown...
            AVCaptureWhiteBalanceTemperatureAndTintValues TempAndTint = new AVCaptureWhiteBalanceTemperatureAndTintValues(Temperature.Value, Tint.Value);

            // Convert Color space
            var gains = ThisApp.CaptureDevice.GetDeviceWhiteBalanceGains(TempAndTint);

            // Set the new values
            ThisApp.CaptureDevice.LockForConfiguration(out Error);
            ThisApp.CaptureDevice.SetWhiteBalanceModeLockedWithDeviceWhiteBalanceGains(gains, (time) => {
                // Ignore callback for now
            });
            ThisApp.CaptureDevice.UnlockForConfiguration();
        }
コード例 #5
0
        //                                                  //Camera Dye and Temperature
        protected void ValueChanged(object sender, EventArgs e)
        {
            var TempAndTint = new AVCaptureWhiteBalanceTemperatureAndTintValues
                                  (this.sldTemperature.Value, this.sldTint.Value);
            var StatusDev = acdDevice.GetDeviceWhiteBalanceGains(TempAndTint);

            if (
                acdDevice.LockForConfiguration(out nsError)
                )
            {
                StatusDev = Settings(StatusDev);
                acdDevice.SetWhiteBalanceModeLockedWithDeviceWhiteBalanceGains(StatusDev, null);
                acdDevice.UnlockForConfiguration();
            }
            sldTint.BeginInvokeOnMainThread(() =>
            {
                sldTint.Value = TempAndTint.Tint;
            });
            sldTemperature.BeginInvokeOnMainThread(() =>
            {
                sldTemperature.Value =
            });
        }
コード例 #6
0
		public void OnChangeTintClicked (NSObject sender)
		{
			var temperatureAndTint = new AVCaptureWhiteBalanceTemperatureAndTintValues {
				Temperature = TemperatureSlider.Value,
				Tint = TintSlider.Value
			};

			SetWhiteBalanceGains (VideoDevice.GetDeviceWhiteBalanceGains (temperatureAndTint));
		}