Esempio n. 1
0
        public void DrawTriangle(float x_x, float x_y, float y_x, float y_y, float z_x, float z_y, float stroke, Dx2DColor color)
        {
            _brush.Color = color;

            using (var path = new PathGeometry(_factory))
            {
                using (var sink = path.Open())
                {
                    sink.BeginFigure(new RawVector2(x_x, x_y), FigureBegin.Hollow);
                    sink.AddLine(new RawVector2(y_x, y_y));
                    sink.AddLine(new RawVector2(z_x, z_y));
                    sink.EndFigure(FigureEnd.Closed);
                    sink.Close();
                    _device.DrawGeometry(path, _brush, stroke);
                }
            }
        }
Esempio n. 2
0
 public void DrawText(string text, float x, float y, Dx2DFont font, Dx2DColor color)
 {
     _brush.Color = color;
     _device.DrawText(text, text.Length, font, new RawRectangleF(x, y, float.PositiveInfinity, float.PositiveInfinity), _brush, DrawTextOptions.NoSnap, MeasuringMode.Natural);
 }
Esempio n. 3
0
 public void DrawCircle(float x, float y, float radius, float stroke, Dx2DColor color)
 {
     _brush.Color = color;
     _device.DrawEllipse(new Ellipse(new RawVector2(x, y), radius, radius), _brush, stroke);
 }
Esempio n. 4
0
 public void DrawEllipse(float x, float y, float width, float height, float stroke, Dx2DColor color)
 {
     _brush.Color = color;
     _device.DrawEllipse(new Ellipse(new RawVector2(x, y), width, height), _brush, stroke);
 }
Esempio n. 5
0
 public void DrawRectangle(float x, float y, float width, float height, float stroke, Dx2DColor color)
 {
     _brush.Color = color;
     _device.DrawRectangle(new RawRectangleF(x, y, x + width, y + height), _brush, stroke);
 }
Esempio n. 6
0
 public void DrawRoundedRectangle(float x, float y, float width, float height, float radiusX, float radiusY, float stroke, Dx2DColor color)
 {
     _brush.Color = color;
     _device.DrawRoundedRectangle(new RoundedRectangle()
     {
         Rect = new RawRectangleF(x, y, x + width, y + height), RadiusX = radiusX, RadiusY = radiusY
     }, _brush, stroke);
 }
Esempio n. 7
0
 public void DrawLine(float startX, float startY, float endX, float endY, float stroke, Dx2DColor color)
 {
     _brush.Color = color;
     _device.DrawLine(new RawVector2(startX, startY), new RawVector2(endX, endY), _brush, stroke);
 }
Esempio n. 8
0
 public void ClearScene(Dx2DColor color) => _device.Clear(color);
Esempio n. 9
0
 public void FillEllipse(float x, float y, float width, float height, Dx2DColor color)
 {
     _brush.Color = color;
     _device.FillEllipse(new Ellipse(new RawVector2(x, y), width, height), _brush);
 }
Esempio n. 10
0
 public void FillCircle(float x, float y, float radius, Dx2DColor color)
 {
     _brush.Color = color;
     _device.FillEllipse(new Ellipse(new RawVector2(x, y), radius, radius), _brush);
 }
Esempio n. 11
0
 public void FillRectangle(float x, float y, float width, float height, Dx2DColor color)
 {
     _brush.Color = color;
     _device.FillRectangle(new RawRectangleF(x, y, x + width, y + height), _brush);
 }