Exemplo n.º 1
0
 public void DrawLine(GHIElectronics.TinyCLR.UI.Media.Pen pen, int x0, int y0, int x1, int y1)
 {
     base.VerifyAccess();
     if (pen != null)
     {
         this._bitmap.DrawLine(pen.Color, pen.Thickness, this._x + x0, this._y + y0, this._x + x1, this._y + y1);
     }
 }
Exemplo n.º 2
0
 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);
     }
 }
Exemplo n.º 3
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);
     }
 }
Exemplo n.º 4
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]);
            }
        }