Пример #1
0
        public static Image getScaleImage(string imagePath, Control v)
        {
            FileStream fileStream = File.Open(imagePath, FileMode.Open);
            Image      original   = Image.FromStream((Stream)fileStream);

            fileStream.Close();
            fileStream.Dispose();
            Bitmap bmp    = new Bitmap(original);
            Bitmap bitmap = HuionRender.blowupImage(HuionRender.compressImageWithRate(bmp, v.Width, v.Height),
                                                    DpiHelper.getInstance().XDpi);

            original.Dispose();
            if (bitmap == bmp)
            {
                return((Image)bitmap);
            }
            bmp.Dispose();
            return((Image)bitmap);
        }
Пример #2
0
        public static Image getDllScaleImage(string imageName, Control v)
        {
            Stream stream = new Depot().loadImage(imageName);

            Console.WriteLine(imageName);
            Console.WriteLine(stream.ToString());
            Image original = Image.FromStream(stream);

            stream.Close();
            stream.Dispose();
            Bitmap bmp    = new Bitmap(original);
            Bitmap bitmap = HuionRender.blowupImage(HuionRender.compressImageWithRate(bmp, v.Width, v.Height),
                                                    DpiHelper.getInstance().XDpi);

            original.Dispose();
            if (bitmap == bmp)
            {
                return((Image)bitmap);
            }
            bmp.Dispose();
            return((Image)bitmap);
        }
Пример #3
0
 public static Image GetScaleIco(string deviceTypeName, string extensionStr)
 {
     return((Image)HuionRender.blowupImage(getImage(GetIconPath(deviceTypeName, extensionStr)),
                                           DpiHelper.getInstance().XDpi));
 }
Пример #4
0
        private void FormWorkArea_Load(object sender, EventArgs e)
        {
            this.labelSelectScreen.TextAlign = ContentAlignment.MiddleRight;
            this.setViewTextLocale();
            this.btnIdentify.Visible        = this.displayNum > 1;
            this.KeyPreview                 = true;
            this.buttonCalibration.Location = new Point((this.Width - this.buttonCalibration.Width) / 2,
                                                        this.buttonCalibration.Location.Y);
            this.buttonCalibration.Visible = Convert.ToBoolean(HNStruct.globalInfo.tabletInfo.bMonitor);
            this.buttonCalibration.Click  += new EventHandler(this.ButtonCalibration_Click);
            this.SetComboxDisplay();
            this.huionWorkAreaPictureRect1.Parent              = (Control)this.huionWorkAreaPictrueView1;
            this.huionWorkAreaPictureRect1.DeviceRectRotate    = (int)TabletConfigUtils.config.rotateAngle;
            this.huionWorkAreaPictureRect1.ScreenRectRatio     = TabletConfigUtils.config.screenAreaRatio;
            this.huionWorkAreaPictureRect1.DeviceRectRatio     = TabletConfigUtils.config.workAreaRatio;
            this.huionWorkAreaPictureRect1.ScreenRatioChanged +=
                new EventHandler(this.HuionWorkAreaPictureRect1_ScreenRatioChanged);
            this.huionWorkAreaPictureRect1.DeviceRatioChanged +=
                new EventHandler(this.HuionWorkAreaPictureRect1_DeviceRatioChanged);
            this.huionWorkAreaPictrueView1.Callback   += new EventHandler(this.HuionWorkAreaPictrueView1_Callback);
            this.huionWorkAreaPictrueView1.DeviceImage =
                HuionRender.blowupImage(ImageHelper.getDllImage(HNStruct.devTypeString), DpiHelper.getInstance().XDpi);
            this.huionWorkAreaPictrueView1.setDeviceInfo(HNStruct.globalInfo.layoutTablet.size,
                                                         HNStruct.globalInfo.layoutTablet.penArea, (int)TabletConfigUtils.config.rotateAngle);
            this.textBoxLeft.Text     = Convert.ToDouble(TabletConfigUtils.config.workAreaRatio.l).ToString("0.000");
            this.textBoxRight.Text    = Convert.ToDouble(TabletConfigUtils.config.workAreaRatio.r).ToString("0.000");
            this.textBoxTop.Text      = Convert.ToDouble(TabletConfigUtils.config.workAreaRatio.t).ToString("0.000");
            this.textBoxBottom.Text   = Convert.ToDouble(TabletConfigUtils.config.workAreaRatio.b).ToString("0.000");
            this.textBoxLeft.Click   += new EventHandler(this.onTextFocusEnter);
            this.textBoxRight.Click  += new EventHandler(this.onTextFocusEnter);
            this.textBoxTop.Click    += new EventHandler(this.onTextFocusEnter);
            this.textBoxBottom.Click += new EventHandler(this.onTextFocusEnter);
            switch (TabletConfigUtils.config.rotateAngle)
            {
            case 0:
                this.rotateZero.Checked = true;
                break;

            case 90:
                this.rotateNinety.Checked = true;
                break;

            case 180:
                this.rotateTwoNinety.Checked = true;
                break;

            case 270:
                this.rotateThreeNinety.Checked = true;
                break;
            }
        }