private void setRgb() { this.trackBarR.Value = (int)VcpFeature.GetVCPFeature(m[index], HNStruct.VCPFeature.VIDEO_GAIN_RED)[0]; this.trackBarG.Value = (int)VcpFeature.GetVCPFeature(m[index], HNStruct.VCPFeature.VIDEO_GAIN_GREEN)[0]; this.trackBarB.Value = (int)VcpFeature.GetVCPFeature(m[index], HNStruct.VCPFeature.VIDEO_GAIN_BLUE)[0]; this.trackBarB.Enabled = true; this.trackBarG.Enabled = true; this.trackBarR.Enabled = true; }
private void cboxScreenNum_SelectionChangeCommitted(object sender, EventArgs e) { try { if (!this.cboxScreenNum.SelectedItem.ToString().Contains("Generic Non-PnP Monitor")) { this.enableContorl(); this.cBoxcolorPress.Text = ""; this.cBoxcolorPress.Items.Clear(); index = this.cboxScreenNum.SelectedIndex; m[index].ColorPresets.ForEach((Action <uint>)(cp => { if (!(this.GetColorPressName(cp) != "Unkown")) { return; } this.cBoxcolorPress.Items.Add((object)this.GetColorPressName(cp)); })); this.cBoxcolorPress.SelectedText = "请选择"; Console.WriteLine("切换屏幕成功"); brigtnessVal = VcpFeature.GetVCPFeature(m[index], HNStruct.VCPFeature.LUMINANCE); contrastVal = VcpFeature.GetVCPFeature(m[index], HNStruct.VCPFeature.CONTRAST); factoryResetVal = VcpFeature.GetVCPFeature(m[index], HNStruct.VCPFeature.RESTORE_FACTORY_DEFAULTS); gainRVal = VcpFeature.GetVCPFeature(m[index], HNStruct.VCPFeature.VIDEO_GAIN_RED); gainGVal = VcpFeature.GetVCPFeature(m[index], HNStruct.VCPFeature.VIDEO_GAIN_GREEN); gainBVal = VcpFeature.GetVCPFeature(m[index], HNStruct.VCPFeature.VIDEO_GAIN_BLUE); blackRVal = VcpFeature.GetVCPFeature(m[index], HNStruct.VCPFeature.VIDEO_BLACK_LEVEL_RED); blackGVal = VcpFeature.GetVCPFeature(m[index], HNStruct.VCPFeature.VIDEO_BLACK_LEVEL_GREEN); blackBVal = VcpFeature.GetVCPFeature(m[index], HNStruct.VCPFeature.VIDEO_BLACK_LEVEL_BLUE); this.trackBarR.Maximum = (int)gainRVal[1]; this.trackBarB.Maximum = (int)gainBVal[1]; this.trackBarG.Maximum = (int)gainGVal[1]; this.tBarBrightness.Maximum = (int)brigtnessVal[1]; this.tBarContract.Maximum = (int)contrastVal[1]; this.tBarBrightness.Value = (int)brigtnessVal[0]; this.tBarContract.Value = (int)contrastVal[0]; } else { this.disControl(); } } catch (Exception ex) { this.disControl(); HuionLog.saveLog("change screen", ex.Message); } }