public void DrawEllipse(GHIElectronics.TinyCLR.UI.Media.Brush brush, GHIElectronics.TinyCLR.UI.Media.Pen pen, int x, int y, int xRadius, int yRadius) { base.VerifyAccess(); if (brush != null) { brush.RenderEllipse(this._bitmap, pen, this._x + x, this._y + y, xRadius, yRadius); } else if ((pen != null) && (pen.Thickness > 0)) { this._bitmap.DrawEllipse(pen.Color, pen.Thickness, this._x + x, this._y + y, xRadius, yRadius, Colors.Transparent, 0, 0, Colors.Transparent, 0, 0, 0); } }
public void DrawRectangle(GHIElectronics.TinyCLR.UI.Media.Brush brush, GHIElectronics.TinyCLR.UI.Media.Pen pen, int x, int y, int width, int height) { base.VerifyAccess(); if (brush != null) { brush.RenderRectangle(this._bitmap, pen, this._x + x, this._y + y, width, height); } else if ((pen != null) && (pen.Thickness > 0)) { this._bitmap.DrawRectangle(pen.Color, pen.Thickness, this._x + x, this._y + y, width, height, 0, 0, Colors.Transparent, 0, 0, Colors.Transparent, 0, 0, 0); } }
public void DrawPolygon(GHIElectronics.TinyCLR.UI.Media.Brush brush, GHIElectronics.TinyCLR.UI.Media.Pen pen, int[] pts) { base.VerifyAccess(); brush.RenderPolygon(this._bitmap, pen, pts); int num = pts.Length / 2; for (int i = 0; i < (num - 1); i++) { this.DrawLine(pen, pts[i * 2], pts[(i * 2) + 1], pts[(i * 2) + 2], pts[(i * 2) + 3]); } if (num > 2) { this.DrawLine(pen, pts[(num * 2) - 2], pts[(num * 2) - 1], pts[0], pts[1]); } }