Example #1
0
        private void tBarBrightness_Scroll(object sender, EventArgs e)
        {
            uint newVal = (uint)this.tBarBrightness.Value;

            this.tBarBrightness.Maximum = (int)brigtnessVal[1];
            Console.WriteLine(brigtnessVal[1]);
            VcpFeature.setVCPFeature(m[index], HNStruct.VCPFeature.LUMINANCE, newVal);
        }
Example #2
0
        private void trackBarR_Scroll(object sender, EventArgs e)
        {
            uint newVal = (uint)this.trackBarR.Value;

            this.trackBarR.Maximum = (int)gainRVal[1];
            Console.WriteLine(gainRVal[1]);
            VcpFeature.setVCPFeature(m[index], HNStruct.VCPFeature.VIDEO_GAIN_RED, newVal);
        }
Example #3
0
 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;
 }
Example #4
0
        private void tBarContract_Scroll(object sender, EventArgs e)
        {
            this.tBarContract.Maximum = (int)contrastVal[1];
            uint newVal = (uint)this.tBarContract.Value;

            Console.WriteLine(contrastVal[1]);
            Console.WriteLine(newVal);
            VcpFeature.setVCPFeature(m[index], HNStruct.VCPFeature.CONTRAST, newVal);
        }
Example #5
0
        private void trackBarG_Scroll(object sender, EventArgs e)
        {
            this.trackBarG.Maximum = (int)gainGVal[1];
            uint newVal = (uint)this.trackBarG.Value;

            Console.WriteLine(this.trackBarG.Value);
            Console.WriteLine(gainGVal[1]);
            VcpFeature.setVCPFeature(m[index], HNStruct.VCPFeature.VIDEO_GAIN_GREEN, newVal);
        }
Example #6
0
 public void checkSceenNum()
 {
     try
     {
         m = VcpFeature.GetAllMonitors();
         this.addColorPress(m);
     }
     catch (Exception ex)
     {
         HuionLog.saveLog("检测屏幕", ex.Message);
     }
 }
Example #7
0
 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);
     }
 }
Example #8
0
        private void cBoxcolorPress_SelectedIndexChanged(object sender, EventArgs e)
        {
            int  selectedIndex = this.cBoxcolorPress.SelectedIndex;
            uint newVal        = m[index].ColorPresets[selectedIndex];

            if (this.cBoxcolorPress.SelectedItem.ToString().Equals("6500°K"))
            {
                newVal = 5U;
            }
            else if (this.cBoxcolorPress.SelectedItem.ToString().Equals("9300°K"))
            {
                newVal = 8U;
            }
            else if (this.cBoxcolorPress.SelectedItem.ToString().Equals("User 1"))
            {
                newVal = 11U;
            }
            if (!VcpFeature.setVCPFeature(m[index], HNStruct.VCPFeature.COLOR_PRESET, newVal))
            {
                return;
            }
            this.setRgb();
        }
Example #9
0
 private void btnReset_Click(object sender, EventArgs e)
 {
     VcpFeature.setVCPFeature(m[index], HNStruct.VCPFeature.RESTORE_FACTORY_DEFAULTS, 1U);
 }