コード例 #1
0
        /// <summary>
        /// Disable the camera automatics for gain and exposure. Set exposure time to at least 0.25 seconds.
        /// </summary>
        /// <param name="value">Automatics on and off. True = on, False = off</param>
        private void prepareProperties(bool value)
        {
            VCDSwitchProperty exposureauto = (VCDSwitchProperty)icImagingControl1.VCDPropertyItems.FindInterface(VCDGUIDs.VCDID_Exposure, VCDGUIDs.VCDElement_Auto);

            if (exposureauto != null)
            {
                exposureauto.Switch = value;
            }

            VCDSwitchProperty gainauto = (VCDSwitchProperty)icImagingControl1.VCDPropertyItems.FindInterface(VCDGUIDs.VCDID_Gain, VCDGUIDs.VCDElement_Auto);

            if (gainauto != null)
            {
                gainauto.Switch = value;
            }

            if (!value)
            {
                VCDAbsoluteValueProperty exposureTime = (VCDAbsoluteValueProperty)icImagingControl1.VCDPropertyItems.FindInterface(VCDGUIDs.VCDID_Exposure,
                                                                                                                                   VCDGUIDs.VCDElement_Value, VCDGUIDs.VCDInterface_AbsoluteValue);
                if (exposureTime != null)
                {
                    exposureTime.Value = Math.Min(exposureTime.RangeMax, 0.25);
                }
            }
        }
コード例 #2
0
ファイル: Functions.cs プロジェクト: Bia5310/IC_EasyStart_WPF
 private static void LoadExposure_ToCam(ref VCDAbsoluteValueProperty var, double pvalue)
 {
     if (var != null)
     {
         if (pvalue < var.RangeMin)
         {
             var.Value = var.RangeMin;
         }
         else if (pvalue > var.RangeMax)
         {
             var.Value = var.RangeMax;
         }
         else
         {
             var.Value = pvalue;
         }
     }
 }