private void BnSetParam_Click(object sender, EventArgs e) { string gainshow = null; string exposureshow = null; if ((chooseHIK) && (!chooseBasler)) { float exposure = float.Parse(tbExposure.Text); float gain = float.Parse(tbGain.Text); hIKVisionCamera.SetParam(gain, exposure, ref gainshow, ref exposureshow, camera2); // 显示真实值 tbGain.Text = gainshow; tbExposure.Text = exposureshow; } else if ((chooseBasler) && (!chooseHIK)) { long exposure = long.Parse(tbExposure.Text); long gain = long.Parse(tbGain.Text); baslerCamera.SetParam(gain, exposure, ref gainshow, ref exposureshow, camera1); // 显示真实值 tbGain.Text = gainshow; tbExposure.Text = exposureshow; } else if (chooseUSB && (!chooseBasler) && (!chooseHIK)) { this.camera3.DisplayPropertyPage(IntPtr.Zero); //bool a = this.usbDeviceSource.SetCameraProperty( // CameraControlProperty.Exposure, int.Parse(tbExposure.Text.Trim()), // CameraControlFlags.Manual);//曝光值 //bool b = this.usbDeviceSource.videoSource.SetCameraProperty( // CameraControlProperty.Zoom, int.Parse(tbGain.Text.Trim()), // CameraControlFlags.Manual); //MessageBox.Show(a+" "+b); } }
private void BnSetParam_Click(object sender, EventArgs e) { string gainshow = null; string exposureshow = null; if ((chooseHIK) && (!chooseBasler)) { float exposure = float.Parse(tbExposure.Text); float gain = float.Parse(tbGain.Text); hIKVisionCamera.SetParam(gain, exposure, ref gainshow, ref exposureshow, camera2); // 显示真实值 tbGain.Text = gainshow; tbExposure.Text = exposureshow; } else if ((chooseBasler) && (!chooseHIK)) { long exposure = long.Parse(tbExposure.Text); long gain = long.Parse(tbGain.Text); baslerCamera.SetParam(gain, exposure, ref gainshow, ref exposureshow, camera1); // 显示真实值 tbGain.Text = gainshow; tbExposure.Text = exposureshow; } }