Aracılığıyla paylaş


StylusPoint Yapı

Tanım

Dijitalleştiriciden ve ekran kaleminden toplanan tek bir veri noktasını temsil eder.

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)
Devralma
StylusPoint
Uygulamalar

Örnekler

Aşağıdaki örnek, içindeki her StylusPoint birinin StylusPointCollectionözellik adlarını ve değerlerini alır. Bu örnekte adlı packetOutputbir TextBlock olduğu varsayılır.

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

Açıklamalar

Kullanıcı StylusPoint , dijitalleştiriciyi kullanarak mürekkep girişinde veri toplar. Bir dijitalleştiricinin bildirdiği bilgiler üreticiye bağlı olarak farklılık gösterdiğinden içindeki özellikler StylusPoint farklılık gösterebilir. Bir özelliğin içinde StylusPointolup olmadığını belirlemek için yöntemini çağırın HasProperty . özelliğinde Description hangi özelliklerin bulunduğunu StylusPointbelirten bir StylusPointDescription içerir. Tüm StylusPoint nesneler, (x, y) koordinatlarının yanı sıra basıncı belirten özellikler içerir.

Oluşturucular

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

Belirtilen (x, y) koordinatları, bir ve içinde belirtilen ek parametreleri kullanarak sınıfının yeni bir pressureFactorörneğini StylusPointStylusPointDescriptionbaşlatır.

StylusPoint(Double, Double, Single)

Belirtilen (x, y) koordinatları ve baskıyı kullanarak sınıfın StylusPoint yeni bir örneğini başlatır.

StylusPoint(Double, Double)

Belirtilen (x, y) koordinatları kullanarak sınıfın StylusPoint yeni bir örneğini başlatır.

Alanlar

Name Description
MaxXY

(x, y) koordinat çifti için en büyük geçerli değeri belirtir.

MinXY

(x, y) koordinat çifti için en küçük geçerli değeri belirtir.

Özellikler

Name Description
Description

içinde StylusPointdepolanan özellikleri belirten öğesini alır veya ayarlarStylusPointDescription.

PressureFactor

0 ile 1 arasında, ekran kaleminin oluşturulduğunda dijital hale getiricinin yüzeyine StylusPoint uyguladığı basınç miktarını yansıtan bir değer alır veya ayarlar.

X

x koordinatı StylusPointdeğerini alır veya ayarlar.

Y

y koordinatını StylusPointalır veya ayarlar.

Yöntemler

Name Description
Equals(Object)

Belirtilen nesnenin değerine eşit StylusPointolup olmadığını belirten bir değer döndürür.

Equals(StylusPoint, StylusPoint)

Belirtilen StylusPoint iki nesnenin eşit olup olmadığını gösteren bir Boole değeri döndürür.

Equals(StylusPoint)

Belirtilen StylusPoint değerin geçerli StylusPointdeğerine eşit olup olmadığını gösteren bir Boole değeri döndürür.

GetHashCode()

Bu örneğin karma kodunu döndürür.

GetPropertyValue(StylusPointProperty)

Belirtilen özelliğin değerini döndürür.

HasProperty(StylusPointProperty)

Geçerlinin StylusPoint belirtilen özelliği içerip içermediğini döndürür.

SetPropertyValue(StylusPointProperty, Int32)

Belirtilen özelliği belirtilen değere ayarlar.

ToPoint()

a'yi StylusPoint öğesine Pointdönüştürür.

İşleçler

Name Description
Equality(StylusPoint, StylusPoint)

Belirtilen StylusPoint iki nesneyi karşılaştırır ve eşit olup olmadıklarını belirler.

Explicit(StylusPoint to Point)

Belirtilen StylusPoint öğesini bir Pointöğesine yayınlar.

Inequality(StylusPoint, StylusPoint)

Belirtilen StylusPoint nesnelerin eşit olmadığını gösteren bir Boole değeri döndürür.

Şunlara uygulanır