Пример #1
0
        public override void DrawLines(Pen pen, PointF[] points)
        {
            var brush = new SharpDX.Direct2D1.SolidColorBrush(_renderTarget, pen.Color.ToColor4());

            var strokeStyle = pen.ToStrokeStyle(_renderTarget.Factory);
            var strokeWidth = StrokeWidthFromPen(pen);

            for (int i = 1; i < points.Length; i++)
            {
                _renderTarget.DrawLine(
                    new SharpDX.Vector2(points[i - 1].X, points[i - 1].Y),
                    new SharpDX.Vector2(points[i].X, points[i].Y),
                    brush, strokeWidth, strokeStyle);
            }
        }
Пример #2
0
        public override void DrawLine(Pen pen, PointF pt1, PointF pt2)
        {
            var strokeWidth = StrokeWidthFromPen(pen);
            var strokeStyle = pen.ToStrokeStyle(_renderTarget.Factory);

            _renderTarget.DrawLine(new SharpDX.Vector2(pt1.X, pt1.Y), new SharpDX.Vector2(pt2.X, pt2.Y),
                new SharpDX.Direct2D1.SolidColorBrush(_renderTarget, pen.Color.ToColor4()),
                strokeWidth, strokeStyle);
        }