Ejemplo n.º 1
0
        private void BnGetParam_Click(object sender, EventArgs e)
        {
            // 参数
            string gain     = null; //增益值
            string exposure = null; //暴光值

            if ((chooseHIK) && (!chooseBasler))
            {
                // 获取参数
                hIKVisionCamera.GetParam(ref gain, ref exposure, camera2);
                tbGain.Text     = gain;
                tbExposure.Text = exposure;
            }
            else if ((chooseBasler) && (!chooseHIK))
            {
                // 获取参数
                baslerCamera.GetParam(ref gain, ref exposure, camera1);
                tbGain.Text     = gain;
                tbExposure.Text = exposure;
            }
            else if (chooseUSB && (!chooseBasler) && (!chooseHIK))
            {
                int _exposure, _gain;
                this.usbDeviceSource.GetCameraProperty(CameraControlProperty.Exposure, out _exposure);
                this.usbDeviceSource.GetCameraProperty(CameraControlProperty.Zoom, out _gain);
                this.tbGain.Text     = _gain.ToString();
                this.tbExposure.Text = _exposure.ToString();
            }
        }
Ejemplo n.º 2
0
        private void BnGetParam_Click(object sender, EventArgs e)
        {
            // 参数
            string gain     = null;
            string exposure = null;

            if ((chooseHIK) && (!chooseBasler))
            {
                // 获取参数
                hIKVisionCamera.GetParam(ref gain, ref exposure, camera2);
                tbGain.Text     = gain;
                tbExposure.Text = exposure;
            }
            else if ((chooseBasler) && (!chooseHIK))
            {
                // 获取参数
                baslerCamera.GetParam(ref gain, ref exposure, camera1);
                tbGain.Text     = gain;
                tbExposure.Text = exposure;
            }
        }