PolyBezierSegment.Points プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
この PointCollection オブジェクトを定義する PolyBezierSegment を取得または設定します。
public:
property System::Windows::Media::PointCollection ^ Points { System::Windows::Media::PointCollection ^ get(); void set(System::Windows::Media::PointCollection ^ value); };
public System.Windows.Media.PointCollection Points { get; set; }
member this.Points : System.Windows.Media.PointCollection with get, set
Public Property Points As PointCollection
プロパティ値
この PolyBezierSegment オブジェクトを定義するコレクション。
例
次の例は、2 つの 3 次ベジエ曲線を Points 定義する の PolyBezierSegment プロパティを使用する方法を示しています。
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel>
<Canvas>
<Path Stroke="Black" StrokeThickness="1">
<Path.Data>
<PathGeometry>
<PathGeometry.Figures>
<PathFigureCollection>
<!-- The StartPoint specifies the starting point of the first curve. -->
<PathFigure StartPoint="10,100">
<PathFigure.Segments>
<PathSegmentCollection>
<!-- The PolyBezierSegment specifies two cubic Bezier curves.
The first curve is from 10,100 (start point specified above)
to 300,100 with a control point of 0,0 and another control
point of 200,0. The second curve is from 300,100
(end of the last curve) to 600,100 with a control point of 300,0
and another control point of 400,0. -->
<PolyBezierSegment Points="0,0 200,0 300,100 300,0 400,0 600,100" />
</PathSegmentCollection>
</PathFigure.Segments>
</PathFigure>
</PathFigureCollection>
</PathGeometry.Figures>
</PathGeometry>
</Path.Data>
</Path>
</Canvas>
</StackPanel>
</Page>
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Shapes;
namespace SDKSample
{
public partial class PolyBezierSegmentExample : Page
{
public PolyBezierSegmentExample()
{
// Create a PathFigure to be used for the PathGeometry of myPath.
PathFigure myPathFigure = new PathFigure();
// Set the starting point for the PathFigure specifying that the
// geometry starts at point 10,100.
myPathFigure.StartPoint = new Point(10, 100);
// Create a PointCollection that holds the Points used to specify
// the points of the PolyBezierSegment below.
PointCollection myPointCollection = new PointCollection(6);
myPointCollection.Add(new Point(0, 0));
myPointCollection.Add(new Point(200, 0));
myPointCollection.Add(new Point(300, 100));
myPointCollection.Add(new Point(300, 0));
myPointCollection.Add(new Point(400, 0));
myPointCollection.Add(new Point(600, 100));
// The PolyBezierSegment specifies two cubic Bezier curves.
// The first curve is from 10,100 (start point specified by the PathFigure)
// to 300,100 with a control point of 0,0 and another control point
// of 200,0. The second curve is from 300,100 (end of the last curve) to
// 600,100 with a control point of 300,0 and another control point of 400,0.
PolyBezierSegment myBezierSegment = new PolyBezierSegment();
myBezierSegment.Points = myPointCollection;
PathSegmentCollection myPathSegmentCollection = new PathSegmentCollection();
myPathSegmentCollection.Add(myBezierSegment);
myPathFigure.Segments = myPathSegmentCollection;
PathFigureCollection myPathFigureCollection = new PathFigureCollection();
myPathFigureCollection.Add(myPathFigure);
PathGeometry myPathGeometry = new PathGeometry();
myPathGeometry.Figures = myPathFigureCollection;
// Create a path to draw a geometry with.
Path myPath = new Path();
myPath.Stroke = Brushes.Black;
myPath.StrokeThickness = 1;
// specify the shape (quadratic Bezier curve) of the path using the StreamGeometry.
myPath.Data = myPathGeometry;
// Add path shape to the UI.
StackPanel mainPanel = new StackPanel();
mainPanel.Children.Add(myPath);
this.Content = mainPanel;
}
}
}
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Media
Imports System.Windows.Shapes
Namespace SDKSample
Partial Public Class PolyBezierSegmentExample
Inherits Page
Public Sub New()
' Create a PathFigure to be used for the PathGeometry of myPath.
Dim myPathFigure As New PathFigure()
' Set the starting point for the PathFigure specifying that the
' geometry starts at point 10,100.
myPathFigure.StartPoint = New Point(10, 100)
' Create a PointCollection that holds the Points used to specify
' the points of the PolyBezierSegment below.
Dim myPointCollection As New PointCollection(6)
myPointCollection.Add(New Point(0, 0))
myPointCollection.Add(New Point(200, 0))
myPointCollection.Add(New Point(300, 100))
myPointCollection.Add(New Point(300, 0))
myPointCollection.Add(New Point(400, 0))
myPointCollection.Add(New Point(600, 100))
' The PolyBezierSegment specifies two cubic Bezier curves.
' The first curve is from 10,100 (start point specified by the PathFigure)
' to 300,100 with a control point of 0,0 and another control point
' of 200,0. The second curve is from 300,100 (end of the last curve) to
' 600,100 with a control point of 300,0 and another control point of 400,0.
Dim myBezierSegment As New PolyBezierSegment()
myBezierSegment.Points = myPointCollection
Dim myPathSegmentCollection As New PathSegmentCollection()
myPathSegmentCollection.Add(myBezierSegment)
myPathFigure.Segments = myPathSegmentCollection
Dim myPathFigureCollection As New PathFigureCollection()
myPathFigureCollection.Add(myPathFigure)
Dim myPathGeometry As New PathGeometry()
myPathGeometry.Figures = myPathFigureCollection
' Create a path to draw a geometry with.
Dim myPath As New Path()
myPath.Stroke = Brushes.Black
myPath.StrokeThickness = 1
' specify the shape (quadratic Bezier curve) of the path using the StreamGeometry.
myPath.Data = myPathGeometry
' Add path shape to the UI.
Dim mainPanel As New StackPanel()
mainPanel.Children.Add(myPath)
Me.Content = mainPanel
End Sub
End Class
End Namespace
注釈
依存プロパティ情報
識別子フィールド | PointsProperty |
に設定されたメタデータ プロパティ true |
なし |
適用対象
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
.NET