public virtual void recreateImage() { unchecked { global::System.Drawing.Bitmap newImage = new global::System.Drawing.Bitmap(((int)(this._width)), ((int)(this._height)), ((global::System.Drawing.Imaging.PixelFormat)(global::System.Drawing.Imaging.PixelFormat.Format32bppArgb))); global::System.Drawing.Graphics newGraphics = global::System.Drawing.Graphics.FromImage(newImage); newGraphics.SmoothingMode = global::System.Drawing.Drawing2D.SmoothingMode.HighQuality; newGraphics.TextRenderingHint = global::System.Drawing.Text.TextRenderingHint.AntiAlias; newGraphics.Clear(global::System.Drawing.Color.Transparent); this._image.Dispose(); this._graphics.Dispose(); this._image = newImage; this._graphics = newGraphics; } }
public void MakeTransparent(Color transColor) { if (Bitmap == null) { return; } try { Bitmap b = new global::System.Drawing.Bitmap(Bitmap.Width, Bitmap.Height, global::System.Drawing.Imaging.PixelFormat.Format32bppArgb); using (global::System.Drawing.Graphics g = global::System.Drawing.Graphics.FromImage(b)) { g.DrawImage(Bitmap, 0, 0); } b.MakeTransparent(transColor); Bitmap.Dispose(); Bitmap = b; } catch { } }
static public float PrimaryScreenDPI(bool forceRefresh = false) { if (_primaryScreenDPI != -1 && forceRefresh == false) { return(_primaryScreenDPI); } try { using (global::System.Drawing.Graphics gr = global::System.Drawing.Graphics.FromHwndInternal(IntPtr.Zero)) { _primaryScreenDPI = gr.DpiX; } } catch { _primaryScreenDPI = 96f; } return(_primaryScreenDPI); }
public override object __hx_setField(string field, int hash, object @value, bool handleProperties) { unchecked { switch (hash) { case 672263473: { this._textBaseline = ((global::alphatab.model.TextBaseline)(@value)); return(@value); } case 2002104775: { this._stringFormat = ((global::System.Drawing.StringFormat)(@value)); return(@value); } case 371286681: { this._textAlign = ((global::alphatab.platform.model.TextAlign)(@value)); return(@value); } case 1993439662: { this._font = ((global::System.Drawing.Font)(@value)); return(@value); } case 375895439: { this._fontSize = ((double)(global::haxe.lang.Runtime.toDouble(@value))); return(@value); } case 1828730163: { this._lineWidth = ((double)(global::haxe.lang.Runtime.toDouble(@value))); return(@value); } case 1178843300: { this._color = ((global::System.Drawing.Color)(@value)); return(@value); } case 1059101146: { this._pen = ((global::System.Drawing.Pen)(@value)); return(@value); } case 887070651: { this._brush = ((global::System.Drawing.SolidBrush)(@value)); return(@value); } case 1658522975: { this._currentY = ((float)(global::haxe.lang.Runtime.toInt(@value))); return(@value); } case 1658522974: { this._currentX = ((float)(global::haxe.lang.Runtime.toInt(@value))); return(@value); } case 1760390271: { this._currentPath = ((global::System.Drawing.Drawing2D.GraphicsPath)(@value)); return(@value); } case 1509814314: { this._graphics = ((global::System.Drawing.Graphics)(@value)); return(@value); } case 1891834246: { this._height = ((int)(global::haxe.lang.Runtime.toInt(@value))); return(@value); } case 1179254087: { this._width = ((int)(global::haxe.lang.Runtime.toInt(@value))); return(@value); } case 961570460: { this._image = ((global::System.Drawing.Bitmap)(@value)); return(@value); } default: { return(base.__hx_setField(field, hash, @value, handleProperties)); } } } }
public override object __hx_setField(string field, int hash, object @value, bool handleProperties) { unchecked { switch (hash) { case 672263473: { this._textBaseline = ((global::alphatab.model.TextBaseline) (@value) ); return @value; } case 2002104775: { this._stringFormat = ((global::System.Drawing.StringFormat) (@value) ); return @value; } case 371286681: { this._textAlign = ((global::alphatab.platform.model.TextAlign) (@value) ); return @value; } case 1993439662: { this._font = ((global::System.Drawing.Font) (@value) ); return @value; } case 375895439: { this._fontSize = ((double) (global::haxe.lang.Runtime.toDouble(@value)) ); return @value; } case 1828730163: { this._lineWidth = ((double) (global::haxe.lang.Runtime.toDouble(@value)) ); return @value; } case 1178843300: { this._color = ((global::System.Drawing.Color) (@value) ); return @value; } case 1059101146: { this._pen = ((global::System.Drawing.Pen) (@value) ); return @value; } case 887070651: { this._brush = ((global::System.Drawing.SolidBrush) (@value) ); return @value; } case 1658522975: { this._currentY = ((float) (global::haxe.lang.Runtime.toInt(@value)) ); return @value; } case 1658522974: { this._currentX = ((float) (global::haxe.lang.Runtime.toInt(@value)) ); return @value; } case 1760390271: { this._currentPath = ((global::System.Drawing.Drawing2D.GraphicsPath) (@value) ); return @value; } case 1509814314: { this._graphics = ((global::System.Drawing.Graphics) (@value) ); return @value; } case 1891834246: { this._height = ((int) (global::haxe.lang.Runtime.toInt(@value)) ); return @value; } case 1179254087: { this._width = ((int) (global::haxe.lang.Runtime.toInt(@value)) ); return @value; } case 961570460: { this._image = ((global::System.Drawing.Bitmap) (@value) ); return @value; } default: { return base.__hx_setField(field, hash, @value, handleProperties); } } } }
public virtual void recreateImage() { unchecked { global::System.Drawing.Bitmap newImage = new global::System.Drawing.Bitmap(((int) (this._width) ), ((int) (this._height) ), ((global::System.Drawing.Imaging.PixelFormat) (global::System.Drawing.Imaging.PixelFormat.Format32bppArgb) )); global::System.Drawing.Graphics newGraphics = global::System.Drawing.Graphics.FromImage(newImage); newGraphics.SmoothingMode = global::System.Drawing.Drawing2D.SmoothingMode.HighQuality; newGraphics.TextRenderingHint = global::System.Drawing.Text.TextRenderingHint.AntiAlias; newGraphics.Clear(global::System.Drawing.Color.Transparent); this._image.Dispose(); this._graphics.Dispose(); this._image = newImage; this._graphics = newGraphics; } }