internal override void RenderRectangle(Bitmap bmp, Pen pen, int x, int y, int width, int height) { GHIElectronics.TinyCLR.UI.Media.Color outlineColor = (pen != null) ? pen.Color : Colors.Transparent; ushort outlineThickness = 0; if (pen != null) { outlineThickness = pen.Thickness; } bmp.DrawRectangle(outlineColor, outlineThickness, x, y, width, height, 0, 0, this.Color, 0, 0, this.Color, 0, 0, base.Opacity); }
internal override void RenderEllipse(Bitmap bmp, Pen pen, int x, int y, int xRadius, int yRadius) { GHIElectronics.TinyCLR.UI.Media.Color color = (pen != null) ? pen.Color : Colors.Transparent; ushort thickness = 0; if (pen != null) { thickness = pen.Thickness; } bmp.DrawEllipse(color, thickness, x, y, xRadius, yRadius, this.Color, 0, 0, this.Color, 0, 0, base.Opacity); }
public bool DrawText(ref string text, Font font, GHIElectronics.TinyCLR.UI.Media.Color color, int x, int y, int width, int height, TextAlignment alignment, TextTrimming trimming) { base.VerifyAccess(); uint flags = 1; switch (alignment) { case TextAlignment.Left: break; case TextAlignment.Center: flags |= 2; break; case TextAlignment.Right: flags |= 0x20; break; default: throw new NotSupportedException(); } if (trimming != TextTrimming.CharacterEllipsis) { if (trimming == TextTrimming.WordEllipsis) { flags |= 8; } } else { flags |= 0x40; } int xRelStart = 0; int yRelStart = 0; return(this._bitmap.DrawTextInRect(ref text, ref xRelStart, ref yRelStart, this._x + x, this._y + y, width, height, flags, color, font)); }
public Pen(GHIElectronics.TinyCLR.UI.Media.Color color) : this(color, 1) { }
public Pen(GHIElectronics.TinyCLR.UI.Media.Color color, ushort thickness) { this.Color = color; this.Thickness = thickness; }
public void SetPixel(GHIElectronics.TinyCLR.UI.Media.Color color, int x, int y) { base.VerifyAccess(); this._bitmap.SetPixel(this._x + x, this._y + y, color); }
public void DrawText(string text, Font font, GHIElectronics.TinyCLR.UI.Media.Color color, int x, int y) { base.VerifyAccess(); this._bitmap.DrawText(text, font, color, this._x + x, this._y + y); }
public SolidColorBrush(GHIElectronics.TinyCLR.UI.Media.Color color) { this.Color = color; }