Stroke.GetBezierStylusPoints 메서드

정의

Stroketrue인 경우 FitToCurve에서 사용하는 스타일러스 지점을 반환합니다.

public:
 System::Windows::Input::StylusPointCollection ^ GetBezierStylusPoints();
public System.Windows.Input.StylusPointCollection GetBezierStylusPoints ();
member this.GetBezierStylusPoints : unit -> System.Windows.Input.StylusPointCollection
Public Function GetBezierStylusPoints () As StylusPointCollection

반환

StylusPointCollection

StylusPointCollection 시기 FitToCurve 의 척추를 따라 스타일러스 점이 들어 있는 A Stroke 입니다true.

예제

다음 예제에서는 각 원을 그리려면 StylusPoint 의 한 Stroke합니다. 경우는 FitToCurve 속성이 trueGetBezierStylusPoints 스타일러스 포인트를 가져오는 데 사용 됩니다. 그렇지 않은 경우는 StylusPoints 속성을 사용 합니다.

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

설명

GetBezierStylusPoints 메서드는 새 반환 StylusPointCollection 스타일러스를 포함 하는 지점에 Stroke 때 사용 하는 FitToCurve 속성을를 DrawingAttributes 속성 true. 되는 스타일러스 지점을 가져올 때 사용 되는 FitToCurve 로 설정 된 false를 사용 하 여는 StylusPoints 속성입니다.

적용 대상