public static Image getPenImage() { return((Image)HuionRender.blowupImage( ImageHelper.getDllImage(Marshal.PtrToStringUni( HuionDriverDLL.hnp_get_pen_image((HnConst.HNTabletType)HNStruct.globalInfo.tabletInfo.devType))), DpiHelper.getInstance().XDpi)); }
private void SetAllControlImage() { Image image; if (this.mOemType == OEMType.HUION) { image = (Image)HuionRender.blowupImage(ImageHelper.getDllImage("logo.png", OEMType.HUION), DpiHelper.getInstance().XDpi); this.buttonWeb.BackgroundImage = (Image)ImageHelper.getDllImage("BANNER.jpg", OEMType.HUION); this.buttonLOGO.Size = image.Size; int x = this.panelButton.Right / 2 + (this.Width - this.buttonLOGO.Width) / 2; if (x < 0) { x = 0; } this.buttonLOGO.Location = new Point(x, this.panelButton.Bottom - this.buttonLOGO.Height); } else { image = (Image)HuionRender.blowupImage(ImageHelper.getDllImage("logo.png", this.mOemType), DpiHelper.getInstance().XDpi); this.buttonWeb.Visible = false; this.buttonLOGO.SetBounds((this.Width - image.Width) / 2, 100, image.Width, image.Height); } this.buttonLOGO.BackgroundImage = image; }
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; } }
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); }
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); }
public static Image GetScaleIco(string deviceTypeName, string extensionStr) { return((Image)HuionRender.blowupImage(getImage(GetIconPath(deviceTypeName, extensionStr)), DpiHelper.getInstance().XDpi)); }