Esempio n. 1
0
 public void DrawRectangles(DUIPen pen, Rectangle[] rects)
 {
     foreach (Rectangle rect in rects)
     {
         DrawRectangle(pen, rect);
     }
 }
Esempio n. 2
0
 public void DrawEllipses(DUIPen pen, RectangleF[] rects)
 {
     foreach (RectangleF rect in rects)
     {
         DrawEllipse(pen, rect);
     }
 }
Esempio n. 3
0
 public void DrawBezier(DUIPen pen, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
 {
     pen.RenderTarget = this.target;
     if (pen.IsDefaultStyleProperties)
     {
         using (SharpDX.Direct2D1.PathGeometry pathGeometry = new SharpDX.Direct2D1.PathGeometry(this.target.RenderTarget.Factory))
             using (SharpDX.Direct2D1.GeometrySink geometrySink = pathGeometry.Open())
             {
                 geometrySink.BeginFigure(DxConvert.ToVector2(x1, y1), SharpDX.Direct2D1.FigureBegin.Hollow);
                 geometrySink.AddBezier(new SharpDX.Direct2D1.BezierSegment()
                 {
                     Point1 = DxConvert.ToVector2(x2, y2), Point2 = DxConvert.ToVector2(x3, y3), Point3 = DxConvert.ToVector2(x4, y4)
                 });
                 geometrySink.EndFigure(SharpDX.Direct2D1.FigureEnd.Open);
                 geometrySink.Close();
                 this.target.RenderTarget.DrawGeometry(pathGeometry, pen, pen.Width);
             }
     }
     else
     {
         using (SharpDX.Direct2D1.PathGeometry pathGeometry = new SharpDX.Direct2D1.PathGeometry(this.target.RenderTarget.Factory))
             using (SharpDX.Direct2D1.GeometrySink geometrySink = pathGeometry.Open())
             {
                 geometrySink.BeginFigure(DxConvert.ToVector2(x1, y1), SharpDX.Direct2D1.FigureBegin.Hollow);
                 geometrySink.AddBezier(new SharpDX.Direct2D1.BezierSegment()
                 {
                     Point1 = DxConvert.ToVector2(x2, y2), Point2 = DxConvert.ToVector2(x3, y3), Point3 = DxConvert.ToVector2(x4, y4)
                 });
                 geometrySink.EndFigure(SharpDX.Direct2D1.FigureEnd.Open);
                 geometrySink.Close();
                 this.target.RenderTarget.DrawGeometry(pathGeometry, pen, pen.Width, pen);
             }
     }
 }
Esempio n. 4
0
 public void DrawEllipse(DUIPen pen, float x, float y, float width, float height)
 {
     if (pen.Width == 0 || width == 0 || height == 0)
     {
         return;
     }
     this.iDUIGraphics.DrawEllipse(pen, x, y, width, height);
 }
Esempio n. 5
0
 public void DrawBezier(DUIPen pen, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
 {
     if (pen.Width == 0)
     {
         return;
     }
     this.iDUIGraphics.DrawBezier(pen, x1, y1, x2, y2, x3, y3, x4, y4);
 }
Esempio n. 6
0
 public void DrawRoundedRectangle(DUIPen pen, float x, float y, float width, float height, float radius)
 {
     if (width <= 0 || height <= 0)
     {
         return;
     }
     this.graphics.DrawPath(pen, Tools.GetRoundRectangleF(new RectangleF(x, y, width, height), radius));
 }
Esempio n. 7
0
 public void DrawRoundedRectangle(DUIPen pen, float x, float y, float width, float height, float radius)
 {
     if (pen.Width == 0 || width == 0 || height == 0)
     {
         return;
     }
     this.iDUIGraphics.DrawRoundedRectangle(pen, x, y, width, height, radius);
 }
Esempio n. 8
0
 public void DrawLine(DUIPen pen, float x1, float y1, float x2, float y2)
 {
     if (pen.Width == 0)
     {
         return;
     }
     if (x1 == x2 && y1 == y2)
     {
         return;
     }
     this.iDUIGraphics.DrawLine(pen, x1, y1, x2, y2);
 }
Esempio n. 9
0
 public void DrawRoundedRectangle(DUIPen pen, float x, float y, float width, float height, float radius)
 {
     pen.RenderTarget = this.target;
     if (pen.IsDefaultStyleProperties)
     {
         this.target.RenderTarget.DrawRoundedRectangle(DxConvert.ToRoundRectF(x, y, width, height, radius), pen, pen.Width);
     }
     else
     {
         this.target.RenderTarget.DrawRoundedRectangle(DxConvert.ToRoundRectF(x, y, width, height, radius), pen, pen.Width, pen);
     }
 }
Esempio n. 10
0
 public void DrawLine(DUIPen pen, float x1, float y1, float x2, float y2)
 {
     pen.RenderTarget = this.target;
     if (pen.IsDefaultStyleProperties)
     {
         this.target.RenderTarget.DrawLine(new SharpDX.Mathematics.Interop.RawVector2(x1, y1), new SharpDX.Mathematics.Interop.RawVector2(x2, y2), pen, pen.Width);
     }
     else
     {
         this.target.RenderTarget.DrawLine(new SharpDX.Mathematics.Interop.RawVector2(x1, y1), new SharpDX.Mathematics.Interop.RawVector2(x2, y2), pen, pen.Width, pen);
     }
 }
Esempio n. 11
0
 public void DrawEllipse(DUIPen pen, float x, float y, float width, float height)
 {
     pen.RenderTarget = this.target;
     if (pen.IsDefaultStyleProperties)
     {
         this.target.RenderTarget.DrawEllipse(DxConvert.ToEllipse(new RectangleF(x, y, width, height)), pen, pen.Width);
     }
     else
     {
         this.target.RenderTarget.DrawEllipse(DxConvert.ToEllipse(new RectangleF(x, y, width, height)), pen, pen.Width, pen);
     }
 }
Esempio n. 12
0
 public void DrawLines(DUIPen pen, PointF[] points)
 {
     if (points.Length < 2)
     {
         return;
     }
     for (int i = 1; i < points.Length; i++)
     {
         PointF pt1 = points[i - 1];
         PointF pt2 = points[i];
         this.DrawLine(pen, pt1, pt2);
     }
 }
Esempio n. 13
0
 public void DrawPolygon(DUIPen pen, PointF[] points)
 {
     if (pen.Width == 0)
     {
         return;
     }
     if (points == null)
     {
         return;
     }
     if (points.Length < 3)
     {
         return;
     }
     this.iDUIGraphics.DrawPolygon(pen, points);
 }
Esempio n. 14
0
        public void DrawPolygon(DUIPen pen, PointF[] points)
        {
            bool closed = true;

            if (points == null)
            {
                return;
            }
            if (points.Length < (closed ? 3 : 2))
            {
                return;
            }
            pen.RenderTarget = this.target;
            if (pen.IsDefaultStyleProperties)
            {
                using (SharpDX.Direct2D1.PathGeometry pathGeometry = new SharpDX.Direct2D1.PathGeometry(this.target.RenderTarget.Factory))
                    using (SharpDX.Direct2D1.GeometrySink geometrySink = pathGeometry.Open())
                    {
                        geometrySink.BeginFigure(DxConvert.ToVector2(points[0]), SharpDX.Direct2D1.FigureBegin.Filled);
                        for (int i = 1; i < points.Length; i++)
                        {
                            geometrySink.AddLine(DxConvert.ToVector2(points[i]));
                        }
                        geometrySink.EndFigure(closed ? SharpDX.Direct2D1.FigureEnd.Closed : SharpDX.Direct2D1.FigureEnd.Open);
                        geometrySink.Close();
                        this.target.RenderTarget.DrawGeometry(pathGeometry, pen, pen.Width);
                    }
            }
            else
            {
                using (SharpDX.Direct2D1.PathGeometry pathGeometry = new SharpDX.Direct2D1.PathGeometry(this.target.RenderTarget.Factory))
                    using (SharpDX.Direct2D1.GeometrySink geometrySink = pathGeometry.Open())
                    {
                        geometrySink.BeginFigure(DxConvert.ToVector2(points[0]), SharpDX.Direct2D1.FigureBegin.Filled);
                        for (int i = 1; i < points.Length; i++)
                        {
                            geometrySink.AddLine(DxConvert.ToVector2(points[i]));
                        }
                        geometrySink.EndFigure(closed ? SharpDX.Direct2D1.FigureEnd.Closed : SharpDX.Direct2D1.FigureEnd.Open);
                        geometrySink.Close();
                        this.target.RenderTarget.DrawGeometry(pathGeometry, pen, pen.Width, pen);
                    }
            }
        }
Esempio n. 15
0
 public void DrawBezier(DUIPen pen, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
 {
     this.graphics.DrawBezier(pen, x1, y1, x2, y2, x3, y3, x4, y4);
 }
Esempio n. 16
0
 public void DrawLine(DUIPen pen, float x1, float y1, float x2, float y2)
 {
     this.graphics.DrawLine(pen, x1, y1, x2, y2);
 }
Esempio n. 17
0
 public void DrawPolygon(DUIPen pen, PointF[] points)
 {
     this.graphics.DrawPolygon(pen, points);
 }
Esempio n. 18
0
 public void DrawEllipse(DUIPen pen, float x, float y, float width, float height)
 {
     this.graphics.DrawEllipse(pen, x, y, width, height);
 }
Esempio n. 19
0
 public void DrawRoundedRectangle(DUIPen pen, RectangleF rect, float radius)
 {
     this.DrawRoundedRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height, radius);
 }
Esempio n. 20
0
 public void DrawEllipse(DUIPen pen, int x, int y, int width, int height)
 {
     this.DrawEllipse(pen, (float)x, (float)y, (float)width, (float)height);
 }
Esempio n. 21
0
 public void DrawBezier(DUIPen pen, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
 {
     this.DrawBezier(pen, (float)x1, (float)y1, (float)x2, (float)y2, (float)x3, (float)y3, (float)x4, (float)y4);
 }
Esempio n. 22
0
 public void DrawEllipse(DUIPen pen, RectangleF rect)
 {
     this.DrawEllipse(pen, rect.X, rect.Y, rect.Width, rect.Height);
 }
Esempio n. 23
0
 public void DrawLine(DUIPen pen, int x1, int y1, int x2, int y2)
 {
     this.DrawLine(pen, (float)x1, (float)y1, (float)x2, (float)y2);
 }
Esempio n. 24
0
 public void DrawLines(DUIPen pen, Point[] points)
 {
     this.DrawLines(pen, points.Select(p => new PointF(p.X, p.Y)).ToArray());
 }
Esempio n. 25
0
 public void DrawBezier(DUIPen pen, PointF p1, PointF p2, PointF p3, PointF p4)
 {
     this.DrawBezier(pen, p1.X, p1.Y, p2.X, p2.Y, p3.X, p3.Y, p4.X, p4.Y);
 }
Esempio n. 26
0
 public void DrawPolygon(DUIPen pen, Point[] points)
 {
     this.DrawPolygon(pen, points.Select(p => (PointF)p).ToArray());
 }
Esempio n. 27
0
 public void DrawLine(DUIPen pen, PointF pt1, PointF pt2)
 {
     this.DrawLine(pen, pt1.X, pt1.Y, pt2.X, pt2.Y);
 }
Esempio n. 28
0
 public void DrawRoundedRectangle(DUIPen pen, int x, int y, int width, int height, float radius)
 {
     this.DrawRoundedRectangle(pen, (float)x, (float)y, (float)width, (float)height, radius);
 }