StylusPoint 구조체

정의

디지타이저와 스타일러스에서 수집된 단일 데이터 지점을 나타냅니다.Represents a single data point collected from the digitizer and stylus.

public value class StylusPoint : IEquatable<System::Windows::Input::StylusPoint>
public struct StylusPoint : IEquatable<System.Windows.Input.StylusPoint>
type StylusPoint = struct
Public Structure StylusPoint
Implements IEquatable(Of StylusPoint)
상속
StylusPoint
구현

예제

다음 예제에서는 각각에 대 한 속성 이름 및 값을 가져옵니다 StylusPointStylusPointCollection합니다.The following example gets property names and values for each StylusPoint in a StylusPointCollection. 이 예제에서는 있다고 가정를 TextBlock 호출 packetOutput합니다.This example assumes that there is a TextBlock called packetOutput.

private void WriteStylusPointValues(StylusPointCollection points)
{
    StylusPointDescription pointsDescription = points.Description;

    ReadOnlyCollection<StylusPointPropertyInfo> properties = 
        pointsDescription.GetStylusPointProperties();
    
    // Write the name and value of each property in
    // every stylus point.
    StringWriter packetWriter = new StringWriter();
    packetWriter.WriteLine("{0} stylus points", points.Count.ToString());
    foreach (StylusPoint stylusPoint in points)
    {
        packetWriter.WriteLine("Stylus Point info");
        packetWriter.WriteLine("X: {0}", stylusPoint.X.ToString());
        packetWriter.WriteLine("Y: {0}", stylusPoint.Y.ToString());
        packetWriter.WriteLine("Pressure: {0}", stylusPoint.PressureFactor.ToString());

        // Get the property name and value for each StylusPoint.
        // Note that this loop reports the X, Y, and pressure values differantly than 
        // getting their values above.
        for (int i = 0; i < pointsDescription.PropertyCount; ++i)
        {
            StylusPointProperty currentProperty = properties[i];

            // GetStylusPointPropertyName is defined below and returns the
            // name of the property.
            packetWriter.Write("{0}: ", GetStylusPointPropertyName(currentProperty));
            packetWriter.WriteLine(stylusPoint.GetPropertyValue(currentProperty).ToString());
        }
        packetWriter.WriteLine();
    }

    packetOutput.Text = packetWriter.ToString();
}
Private Sub WriteStylusPointValues(ByVal points As StylusPointCollection) 
    Dim pointsDescription As StylusPointDescription = points.Description
    
    Dim properties As ReadOnlyCollection(Of StylusPointPropertyInfo) = _
                            pointsDescription.GetStylusPointProperties()
    
    ' Write the name and value of each property in
    ' every stylus point.
    Dim packetWriter As New StringWriter()

    packetWriter.WriteLine("{0} stylus points", points.Count.ToString())

    For Each stylusPoint As StylusPoint In points

        packetWriter.WriteLine("Stylus Point info")
        packetWriter.WriteLine("X: {0}", stylusPoint.X.ToString())
        packetWriter.WriteLine("Y: {0}", stylusPoint.Y.ToString())
        packetWriter.WriteLine("Pressure: {0}", stylusPoint.PressureFactor.ToString())

        ' Get the property name and value for each StylusPoint.
        ' Note that this loop reports the X, Y, and pressure values differantly than 
        ' getting their values above.
        For i As Integer = 0 To pointsDescription.PropertyCount - 1

            Dim currentProperty As StylusPointProperty = properties(i)

            ' GetStylusPointPropertyName is defined below and returns the
            ' name of the property.
            packetWriter.Write("{0}: ", GetStylusPointPropertyName(currentProperty))
            packetWriter.WriteLine(stylusPoint.GetPropertyValue(currentProperty).ToString())
        Next i

        packetWriter.WriteLine()

    Next stylusPoint

    packetOutput.Text = packetWriter.ToString()

End Sub

// Use reflection to get the name of currentProperty.
private string GetStylusPointPropertyName(StylusPointProperty currentProperty)
{
    Guid guid = currentProperty.Id;

    // Iterate through the StylusPointProperties to find the StylusPointProperty
    // that matches currentProperty, then return the name.
    foreach (FieldInfo theFieldInfo
        in typeof(StylusPointProperties).GetFields())
    {
        StylusPointProperty property = (StylusPointProperty) theFieldInfo.GetValue(currentProperty);
        if (property.Id == guid)
        {
            return theFieldInfo.Name;
        }
    }
    return "Not found";
}
' Use reflection to get the name of currentProperty.
Private Function GetStylusPointPropertyName(ByVal currentProperty As StylusPointProperty) As String 
    Dim guid As Guid = currentProperty.Id
    
    ' Iterate through the StylusPointProperties to find the StylusPointProperty
    ' that matches currentProperty, then return the name.
    Dim theFieldInfo As FieldInfo

    For Each theFieldInfo In GetType(StylusPointProperties).GetFields()

        Dim pointProperty As StylusPointProperty = _
            CType(theFieldInfo.GetValue(currentProperty), StylusPointProperty)

        If pointProperty.Id = guid Then
            Return theFieldInfo.Name
        End If

    Next theFieldInfo

    Return "Not found"

End Function 'GetStylusPointPropertyName

설명

StylusPoint 디지타이저를 사용 하 여 잉크를 입력 하는 경우 데이터를 수집 합니다.A StylusPoint collects data when a user inputs ink using the digitizer. 디지타이저를 보고 하는 정보를 제조업체, 내의 속성에 따라 다르므로 StylusPoint 달라질 수 있습니다.Because the information that a digitizer reports differs depending on the manufacturer, the properties within a StylusPoint can vary. 속성 인지 여부를 결정 하는 StylusPoint를 호출 합니다 HasProperty 메서드.To determine whether a property is in the StylusPoint, call the HasProperty method. Description 속성에 포함을 StylusPointDescription 속성에 지정 하는 StylusPoint합니다.The Description property contains a StylusPointDescription that specifies which properties are in the StylusPoint. 모든 StylusPoint 개체를 지정 하는 속성을 포함 합니다 (x, y) 좌표 뿐만 아니라 압력입니다.All StylusPoint objects contain properties that specify the (x, y) coordinates, as well as the pressure.

생성자

StylusPoint(Double, Double)

지정된 (x, y) 좌표를 사용하여 StylusPoint 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the StylusPoint class using specified (x, y) coordinates.

StylusPoint(Double, Double, Single)

지정된 (x, y) 좌표와 압력을 사용하여 StylusPoint 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the StylusPoint class using specified (x, y) coordinates and pressure.

StylusPoint(Double, Double, Single, StylusPointDescription, Int32[])

지정된 (x, y) 좌표, pressureFactorStylusPointDescription에 지정된 추가 매개 변수를 사용하여 StylusPoint 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the StylusPoint class using specified (x, y) coordinates, a pressureFactor, and additional parameters specified in the StylusPointDescription.

필드

MaxXY

(x, y) 좌표 쌍에 대한 최대 유효 값을 지정합니다.Specifies the largest valid value for a pair of (x, y) coordinates.

MinXY

(x, y) 좌표 쌍에 대한 최소 유효 값을 지정합니다.Specifies the smallest valid value for a pair of (x, y) coordinates.

속성

Description

StylusPointDescription에 저장된 속성을 지정하는 StylusPoint을 가져오거나 설정합니다.Gets or sets the StylusPointDescription that specifies the properties stored in the StylusPoint.

PressureFactor

StylusPoint가 만들어지면 스타일러스가 디지타이저 화면에 적용할 압력을 반영하는 0과 1 사이 값을 가져오거나 설정합니다.Gets or sets a value between 0 and 1 that reflects the amount of pressure the stylus applies to the digitizer's surface when the StylusPoint is created.

X

StylusPoint의 X 좌표 값을 가져오거나 설정합니다.Gets or sets the value for the x-coordinate of the StylusPoint.

Y

StylusPoint의 Y 좌표를 가져오거나 설정합니다.Gets or sets the y-coordinate of the StylusPoint.

메서드

Equals(Object)

지정된 개체가 StylusPoint와 같은지 여부를 나타내는 값을 반환합니다.Returns a value indicating whether the specified object is equal to the StylusPoint.

Equals(StylusPoint)

지정된 StylusPoint가 현재 StylusPoint와 같은지 여부를 나타내는 부울 값을 반환합니다.Returns a Boolean value that indicates whether the specified StylusPoint is equal to the current StylusPoint.

Equals(StylusPoint, StylusPoint)

지정된 두 StylusPoint 개체가 같은지 여부를 나타내는 부울 값을 반환합니다.Returns a Boolean value that indicates whether the two specified StylusPoint objects are equal.

GetHashCode()

이 인스턴스의 해시 코드를 반환합니다.Returns the hash code for this instance.

GetPropertyValue(StylusPointProperty)

지정한 속성의 값을 반환합니다.Returns the value of the specified property.

HasProperty(StylusPointProperty)

현재 StylusPoint에 지정된 속성이 들어 있는지 여부를 반환합니다.Returns whether the current StylusPoint contains the specified property.

SetPropertyValue(StylusPointProperty, Int32)

지정된 속성을 지정된 값으로 설정합니다.Sets the specified property to the specified value.

ToPoint()

StylusPointPoint로 변환합니다.Converts a StylusPoint to a Point.

연산자

Equality(StylusPoint, StylusPoint)

지정된 두 StylusPoint 개체를 비교하여 같은지 여부를 확인합니다.Compares two specified StylusPoint objects and determines whether they are equal.

Explicit(StylusPoint to Point)

지정된 StylusPointPoint로 캐스팅합니다.Casts the specified StylusPoint to a Point.

Inequality(StylusPoint, StylusPoint)

지정된 StylusPoint 개체가 다른지 여부를 나타내는 부울 값을 반환합니다.Returns a Boolean value which indicates whether the specified StylusPoint objects are unequal.

적용 대상