public void cameraparam() { if (!cameraopen()) { return; } try { double ept = 0.0; int rgain = 0; int ggain = 0; int bgain = 0; int ctt = 0; int gm = 0; MvApi.CameraGetExposureTime(m_hCamera, ref ept); MvApi.CameraGetGain(m_hCamera, ref rgain, ref ggain, ref bgain); MvApi.CameraGetContrast(m_hCamera, ref ctt); MvApi.CameraGetGamma(m_hCamera, ref gm); exposuretime = ept; gain = rgain; contrast = ctt; gamma = gm; //exposuretime = hfg.GetFramegrabberParam("ExposureTime"); //gain = hfg.GetFramegrabberParam("Gain")*100; //gamma = hfg.GetFramegrabberParam("Gamma"); //contrast = hfg.GetFramegrabberParam("Contrast"); } catch { } }
private void UpdateRgbGainControls() { int r, g, b; r = g = b = 0; MvApi.CameraGetGain(m_hCamera, ref r, ref g, ref b); trackBar_RedGain.Value = r; trackBar_GreenGain.Value = g; trackBar_BlueGain.Value = b; textBox_RedGain.Text = r.ToString(); textBox_GreenGain.Text = g.ToString(); textBox_BlueGain.Text = b.ToString(); }