Stroke.StylusPoints 속성

정의

Stroke의 스타일러스 지점을 반환합니다.Returns the stylus points of the Stroke.

public:
 property System::Windows::Input::StylusPointCollection ^ StylusPoints { System::Windows::Input::StylusPointCollection ^ get(); void set(System::Windows::Input::StylusPointCollection ^ value); };
public System.Windows.Input.StylusPointCollection StylusPoints { get; set; }
member this.StylusPoints : System.Windows.Input.StylusPointCollection with get, set
Public Property StylusPoints As StylusPointCollection

속성 값

현재 StylusPointCollection를 나타내는 스타일러스 포인트가 들어 있는 Stroke입니다.The StylusPointCollection that contains the stylus points that represent the current Stroke.

예제

다음 예제에서는 재정의 된의 일부인 Stroke 각각에 원을 그리는 StylusPoint합니다.The following example is part of an overridden Stroke that draws a circle at each StylusPoint. 경우는 FitToCurve 속성이 trueGetBezierStylusPoints 스타일러스 포인트를 가져오는 데 사용 됩니다.If the FitToCurve property is set to true, the GetBezierStylusPoints is used to get the stylus points. 그렇지 않은 경우는 StylusPoints 속성을 사용 합니다.Otherwise, the StylusPoints property is used.

protected override void DrawCore(DrawingContext context, DrawingAttributes overrides)
{
    // Draw the stroke. Calling base.DrawCore accomplishes the same thing.
    Geometry geometry = GetGeometry(overrides);
    context.DrawGeometry(new SolidColorBrush(overrides.Color), null, geometry);

    StylusPointCollection points;

    // Get the stylus points used to draw the stroke.  The points used depends on
    // the value of FitToCurve.
    if (this.DrawingAttributes.FitToCurve)
    {
        points = this.GetBezierStylusPoints();
    }
    else
    {
        points = this.StylusPoints;
    }

    // Draw a circle at each stylus point.
    foreach (StylusPoint p in points)
    {
        context.DrawEllipse(null, new Pen(Brushes.Black, 1), (Point)p, 5, 5);
    }
}
Protected Overrides Sub DrawCore(ByVal context As DrawingContext, _
        ByVal overridedAttributes As DrawingAttributes)

    ' Draw the stroke. Calling base.DrawCore accomplishes the same thing.
    Dim geometry As Geometry = GetGeometry(overridedAttributes)
    context.DrawGeometry(New SolidColorBrush(overridedAttributes.Color), Nothing, geometry)

    Dim points As StylusPointCollection

    ' Get the stylus points used to draw the stroke.  The points used depends on
    ' the value of FitToCurve.
    If Me.DrawingAttributes.FitToCurve Then
        points = Me.GetBezierStylusPoints()
    Else
        points = Me.StylusPoints
    End If

    ' Draw a circle at each stylus point.
    Dim p As StylusPoint
    For Each p In points
        context.DrawEllipse(Nothing, New Pen(Brushes.Black, 1), CType(p, Point), 5, 5)
    Next p

End Sub

설명

되는 스타일러스 지점을 가져올 때 사용 되는 FitToCurve 속성에는 DrawingAttributes 속성이로 설정 된 true, 사용를 GetBezierStylusPoints 메서드.To get the stylus points that are used when the FitToCurve property on the DrawingAttributes property is set to true, use the GetBezierStylusPoints method.

참고

StylusPointCollection 에 할당 합니다 StylusPoints 속성이 하나 이상 있어야 StylusPoint 에 합니다.The StylusPointCollection assigned to the StylusPoints property must have at least one StylusPoint in it. 빈 할당 하려고 하면 StylusPointCollectionStylusPoints를 모두 제거 하거나를 StylusPoint 에서 개체 StylusPoints, 예외가 발생 합니다.If you try to assign an empty StylusPointCollection to StylusPoints, or remove all the StylusPoint objects from StylusPoints, an exception occurs.

적용 대상