다음을 통해 공유


Polygon.Points 속성

정의

다각형의 꼭짓점을 포함하는 컬렉션을 가져오거나 설정합니다.

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

속성 값

PointCollection

다각형의 꼭짓점을 설명하는 Point 구조의 컬렉션입니다. 기본값은 null 참조(Visual Basic의 경우 Nothing)입니다.

예제

다음 예제에서는 만드는 방법을 보여 줍니다.는 Polygon 요소는 Points 코드를 사용 하 여 속성입니다.


//Add the Polygon Element
myPolygon = gcnew Polygon();
myPolygon->Stroke = Brushes::Black;
myPolygon->Fill = Brushes::LightSeaGreen;
myPolygon->StrokeThickness = 2;
myPolygon->HorizontalAlignment = HorizontalAlignment::Left;
myPolygon->VerticalAlignment = VerticalAlignment::Center;
Point Point1 = Point(1, 50);
Point Point2 = Point(10, 80);
Point Point3 = Point(50, 50);
PointCollection^ myPointCollection = gcnew PointCollection();
myPointCollection->Add(Point1);
myPointCollection->Add(Point2);
myPointCollection->Add(Point3);
myPolygon->Points = myPointCollection;
myGrid->Children->Add(myPolygon);

//Add the Polygon Element
myPolygon = new Polygon();
myPolygon.Stroke = System.Windows.Media.Brushes.Black;
myPolygon.Fill = System.Windows.Media.Brushes.LightSeaGreen;
myPolygon.StrokeThickness = 2;
myPolygon.HorizontalAlignment = HorizontalAlignment.Left;
myPolygon.VerticalAlignment = VerticalAlignment.Center;
System.Windows.Point Point1 = new System.Windows.Point(1, 50);
System.Windows.Point Point2 = new System.Windows.Point(10,80);
System.Windows.Point Point3 = new System.Windows.Point(50,50);
PointCollection myPointCollection = new PointCollection();
myPointCollection.Add(Point1);
myPointCollection.Add(Point2);
myPointCollection.Add(Point3);
myPolygon.Points = myPointCollection;
myGrid.Children.Add(myPolygon);

' Add a Polygon Element
Dim myPolygon As New Polygon()
myPolygon.Stroke = Brushes.Black
myPolygon.Fill = Brushes.LightSeaGreen
myPolygon.StrokeThickness = 2
myPolygon.HorizontalAlignment = HorizontalAlignment.Left
myPolygon.VerticalAlignment = VerticalAlignment.Center
Dim Point1 As New System.Windows.Point(1, 50)
Dim Point2 As New System.Windows.Point(10, 80)
Dim Point3 As New System.Windows.Point(50, 50)
Dim myPointCollection As New PointCollection()
myPointCollection.Add(Point1)
myPointCollection.Add(Point2)
myPointCollection.Add(Point3)
myPolygon.Points = myPointCollection
myGrid.Children.Add(myPolygon)

설명

XAML(Extensible Application Markup Language)에서 공백으로 구분된 쉼표로 구분된 x 좌표 및 y 좌표 쌍 목록을 사용하여 이 특성을 설정합니다. 사용 하 여 간단한 표기법으로, x1,y1 x2,y2 ... xn,yn합니다.

종속성 속성 정보

식별자 필드 PointsProperty
메타 데이터 속성 설정 true AffectsRender, AffectsMeasure

적용 대상

추가 정보