Exemple #1
0
        private void NUpDownRed_ValueChanged(object sender, EventArgs e)
        {
            int newRedGain = System.Convert.ToInt32(NUpDownRed.Value);

            if (_camEngineStarted)
            {
                myUSBCam.SetGain(newRedGain, myUSBCam.GetGreenGain(), myUSBCam.GetBlueGain());
            }
        }
Exemple #2
0
        public FUSBCam()
        {
            InitializeComponent();

            myUSBCam       = new CCameraUSB(this);
            _callbackCount = 0;

            _numCams = myUSBCam.InitDevice();
            //Populate camera combo box
            if (_numCams > 0)
            {
                string cam = "";
                for (int i = 0; i < _numCams; i++)
                {
                    cam = String.Format("Camera {0}", i + 1);
                    CBCameraSelect.Items.Add(cam);
                }
                //CBCameraSelect.SelectedIndex = 0;
                CBResolution.SelectedIndex = (int)CCameraUSB.RESOLUTION.VGA;
                NUpDownExposureTime.Value  = myUSBCam.GetExpTime() / 1000;

                //ROI
                NUpDownX.Value = myUSBCam.GetXstart();
                NUpDownY.Value = myUSBCam.GetYstart();

                //Gains
                NUpDownRed.Value   = myUSBCam.GetRedGain();
                NUpDownGreen.Value = myUSBCam.GetGreenGain();
                NUpDownBlue.Value  = myUSBCam.GetBlueGain();

                //Set light controls
                //_myLights = lights;
                //double intensity1 = ((CLight)_myLights[0]).IntensityLevel;
                //((CLight)_myLights[0]).SetIntensity(intensity1);
                //SBLightIntensity1.Value = System.Convert.ToInt32(intensity1);
                //TBLightIntensity1.Text = intensity1.ToString("F1");
            }
        }