Beispiel #1
0
        private void HuionWorkAreaPictureRect1_DeviceRatioChanged(object sender, EventArgs e)
        {
            RatioEventArgs ratioEventArgs = (RatioEventArgs)e;

            TabletConfigUtils.config.workAreaRatio = ratioEventArgs.Ratio;
            this.textBoxLeft.Tag   = (object)"1";
            this.textBoxRight.Tag  = (object)"1";
            this.textBoxTop.Tag    = (object)"1";
            this.textBoxBottom.Tag = (object)"1";
            this.textBoxSetting(this.textBoxLeft, e);
            this.textBoxSetting(this.textBoxRight, e);
            this.textBoxSetting(this.textBoxTop, e);
            this.textBoxSetting(this.textBoxBottom, e);
            this.textBoxLeft.Tag   = (object)null;
            this.textBoxRight.Tag  = (object)null;
            this.textBoxTop.Tag    = (object)null;
            this.textBoxBottom.Tag = (object)null;
        }
Beispiel #2
0
        private void textBoxSetting(TextBox textbox, EventArgs e)
        {
            RatioEventArgs ratioEventArgs = (RatioEventArgs)e;

            switch (textbox.Text.Length)
            {
            case 3:
                if (textbox == this.textBoxLeft)
                {
                    textbox.Text = Convert.ToDouble(ratioEventArgs.Ratio.l).ToString("0.0");
                    break;
                }

                if (textbox == this.textBoxRight)
                {
                    textbox.Text = Convert.ToDouble(ratioEventArgs.Ratio.r).ToString("0.0");
                    break;
                }

                if (textbox == this.textBoxTop)
                {
                    textbox.Text = Convert.ToDouble(ratioEventArgs.Ratio.t).ToString("0.0");
                    break;
                }

                if (textbox != this.textBoxBottom)
                {
                    break;
                }
                textbox.Text = Convert.ToDouble(ratioEventArgs.Ratio.b).ToString("0.0");
                break;

            case 4:
                if (textbox == this.textBoxLeft)
                {
                    textbox.Text = Convert.ToDouble(ratioEventArgs.Ratio.l).ToString("0.00");
                    break;
                }

                if (textbox == this.textBoxRight)
                {
                    textbox.Text = Convert.ToDouble(ratioEventArgs.Ratio.r).ToString("0.00");
                    break;
                }

                if (textbox == this.textBoxTop)
                {
                    textbox.Text = Convert.ToDouble(ratioEventArgs.Ratio.t).ToString("0.00");
                    break;
                }

                if (textbox != this.textBoxBottom)
                {
                    break;
                }
                textbox.Text = Convert.ToDouble(ratioEventArgs.Ratio.b).ToString("0.00");
                break;

            case 5:
                if (textbox == this.textBoxLeft)
                {
                    textbox.Text = Convert.ToDouble(ratioEventArgs.Ratio.l).ToString("0.000");
                    break;
                }

                if (textbox == this.textBoxRight)
                {
                    textbox.Text = Convert.ToDouble(ratioEventArgs.Ratio.r).ToString("0.000");
                    break;
                }

                if (textbox == this.textBoxTop)
                {
                    textbox.Text = Convert.ToDouble(ratioEventArgs.Ratio.t).ToString("0.000");
                    break;
                }

                if (textbox != this.textBoxBottom)
                {
                    break;
                }
                textbox.Text = Convert.ToDouble(ratioEventArgs.Ratio.b).ToString("0.000");
                break;
            }
        }
Beispiel #3
0
        private void HuionWorkAreaPictureRect1_ScreenRatioChanged(object sender, EventArgs e)
        {
            RatioEventArgs ratioEventArgs = (RatioEventArgs)e;

            TabletConfigUtils.config.screenAreaRatio = ratioEventArgs.Ratio;
        }