首页 > 代码库 > WPF Path

WPF Path

在WPF中,自定义控件,经常用到Path.

Path可以绘制多边形、边框、线条、简单的图标等。

1、Xaml中用法:

<Path Stroke="DodgerBlue" StrokeThickness="1" Data="http://www.mamicode.com/M50,50 L100,200 L200,50 L50,50"></Path>

技术分享

2、后台中用法:

        Path path=new Path();        path.Stroke = Brushes.DodgerBlue;        path.StrokeThickness = 1;        var aaa = new PathSegmentCollection();        aaa.Add(new LineSegment(new Point(200,20),true));        path.Data=http://www.mamicode.com/new PathGeometry()>

技术分享

 

WPF Path