public static void DrawLine(this ID2D1DeviceContext context, D2D_POINT_2F point0, D2D_POINT_2F point1, ID2D1Brush brush, float strokeWidth, ID2D1StrokeStyle strokeStyle = null)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            if (brush == null)
            {
                throw new ArgumentNullException(nameof(brush));
            }

            context.DrawLine(point0, point1, brush, strokeWidth, strokeStyle);
        }
示例#2
0
        public override void Draw(ID2D1DeviceContext renderTarget, ID2D1SolidColorBrush brush)
        {
            var lines = new[]
            {
                new [] { Points[0], Points[1] },
                new [] { Points[1], Points[2] },
                new [] { Points[2], Points[3] },
                new [] { Points[3], Points[0] },
            };

            foreach (var line in lines)
            {
                renderTarget.DrawLine(line[0].ToPoint(), line[1].ToPoint(), brush, 2.0f);
            }
        }
示例#3
0
 public override void Draw(ID2D1DeviceContext renderTarget, ID2D1SolidColorBrush brush)
 {
     renderTarget.DrawLine(P1.ToPoint(), P2.ToPoint(), brush);
 }