PolyLineSegment 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
表示由 PointCollection 定义的线段集合,每个 Point 指定线段的终点。
public ref class PolyLineSegment sealed : System::Windows::Media::PathSegment
public sealed class PolyLineSegment : System.Windows.Media.PathSegment
type PolyLineSegment = class
inherit PathSegment
Public NotInheritable Class PolyLineSegment
Inherits PathSegment
- 继承
示例
以下示例演示如何使用 PolyLineSegment 指定 段的 PathFigure点。
<Path Stroke="Black" StrokeThickness="1" >
<Path.Data>
<PathGeometry>
<PathGeometry.Figures>
<PathFigure StartPoint="10,50">
<PathFigure.Segments>
<BezierSegment
Point1="100,0"
Point2="200,200"
Point3="300,100"/>
<LineSegment Point="400,100" />
<ArcSegment
Size="50,50" RotationAngle="45"
IsLargeArc="True" SweepDirection="Clockwise"
Point="200,100"/>
</PathFigure.Segments>
</PathFigure>
<PathFigure StartPoint="10,100">
<PathFigure.Segments>
<PolyLineSegment Points="50,100 50,150" />
<QuadraticBezierSegment Point1="200,200" Point2="300,100"/>
</PathFigure.Segments>
</PathFigure>
</PathGeometry.Figures>
</PathGeometry>
</Path.Data>
</Path>
PathGeometry myPathGeometry = new PathGeometry();
// Create a figure.
PathFigure pathFigure1 = new PathFigure();
pathFigure1.StartPoint = new Point(10, 50);
pathFigure1.Segments.Add(
new BezierSegment(
new Point(100, 0),
new Point(200, 200),
new Point(300, 100),
true /* IsStroked */ ));
pathFigure1.Segments.Add(
new LineSegment(
new Point(400, 100),
true /* IsStroked */ ));
pathFigure1.Segments.Add(
new ArcSegment(
new Point(200, 100),
new Size(50, 50),
45,
true, /* IsLargeArc */
SweepDirection.Clockwise,
true /* IsStroked */ ));
myPathGeometry.Figures.Add(pathFigure1);
// Create another figure.
PathFigure pathFigure2 = new PathFigure();
pathFigure2.StartPoint = new Point(10, 100);
Point[] polyLinePointArray =
new Point[] { new Point(50, 100), new Point(50, 150) };
PolyLineSegment myPolyLineSegment = new PolyLineSegment();
myPolyLineSegment.Points =
new PointCollection(polyLinePointArray);
pathFigure2.Segments.Add(myPolyLineSegment);
pathFigure2.Segments.Add(
new QuadraticBezierSegment(
new Point(200, 200),
new Point(300, 100),
true /* IsStroked */ ));
myPathGeometry.Figures.Add(pathFigure2);
// Display the PathGeometry.
Path myPath = new Path();
myPath.Stroke = Brushes.Black;
myPath.StrokeThickness = 1;
myPath.Data = myPathGeometry;
Dim myPathGeometry As New PathGeometry()
' Create a figure.
Dim pathFigure1 As New PathFigure()
pathFigure1.StartPoint = New Point(10,50)
pathFigure1.Segments.Add(New BezierSegment(New Point(100,0), New Point(200,200), New Point(300,100), True)) ' IsStroked
pathFigure1.Segments.Add(New LineSegment(New Point(400,100), True)) ' IsStroked
pathFigure1.Segments.Add(New ArcSegment(New Point(200,100), New Size(50,50), 45, True, SweepDirection.Clockwise, True)) ' IsStroked - IsLargeArc
myPathGeometry.Figures.Add(pathFigure1)
' Create another figure.
Dim pathFigure2 As New PathFigure()
pathFigure2.StartPoint = New Point(10,100)
Dim polyLinePointArray() As Point = { New Point(50, 100), New Point(50, 150)}
Dim myPolyLineSegment As New PolyLineSegment()
myPolyLineSegment.Points = New PointCollection(polyLinePointArray)
pathFigure2.Segments.Add(myPolyLineSegment)
pathFigure2.Segments.Add(New QuadraticBezierSegment(New Point(200,200), New Point(300,100), True)) ' IsStroked
myPathGeometry.Figures.Add(pathFigure2)
' Display the PathGeometry.
Dim myPath As New Path()
myPath.Stroke = Brushes.Black
myPath.StrokeThickness = 1
myPath.Data = myPathGeometry
注解
使用此类在 中创建 PathFigure一系列连接线。
构造函数
PolyLineSegment() |
初始化 PolyLineSegment 类的新实例。 |
PolyLineSegment(IEnumerable<Point>, Boolean) |
使用确定线段的点的指定列表和指示是否绘制线段的值初始化 PolyLineSegment 类的新实例。 |
字段
PointsProperty |
标识 Points 依赖项属性。 |
属性
CanFreeze |
获取一个值,该值指示是否可将对象变为不可修改。 (继承自 Freezable) |
DependencyObjectType |
DependencyObjectType获取包装此实例的 CLR 类型的 。 (继承自 DependencyObject) |
Dispatcher |
获取与此 Dispatcher 关联的 DispatcherObject。 (继承自 DispatcherObject) |
HasAnimatedProperties |
获取一个值,该值指示一个或多个 AnimationClock 对象是否与此对象的任何依赖项属性相关联。 (继承自 Animatable) |
IsFrozen |
获取一个值,该值指示对象当前是否可修改。 (继承自 Freezable) |
IsSealed |
获取一个值,该值指示此实例当前是否为密封的(只读)。 (继承自 DependencyObject) |
IsSmoothJoin |
获取或设置一个值,该值指示在用 PathSegment 为此 PathSegment 和上一个 Pen 描边时是否将它们之间的联接视为角。 (继承自 PathSegment) |
IsStroked |
获取或设置一个值,该值指示是否为该段描边。 (继承自 PathSegment) |
Points |
获取或设置 Point 结构的集合,这些结构定义了此 PolyLineSegment 对象。 |
方法
事件
Changed |
在修改 Freezable 或其包含的对象时发生。 (继承自 Freezable) |