StylusPointDescription.GetPropertyInfo(StylusPointProperty) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the StylusPointPropertyInfo for the specified property.
public:
System::Windows::Input::StylusPointPropertyInfo ^ GetPropertyInfo(System::Windows::Input::StylusPointProperty ^ stylusPointProperty);
public System.Windows.Input.StylusPointPropertyInfo GetPropertyInfo(System.Windows.Input.StylusPointProperty stylusPointProperty);
member this.GetPropertyInfo : System.Windows.Input.StylusPointProperty -> System.Windows.Input.StylusPointPropertyInfo
Public Function GetPropertyInfo (stylusPointProperty As StylusPointProperty) As StylusPointPropertyInfo
- stylusPointProperty
- StylusPointProperty
The StylusPointProperty that specifies the property of the desired StylusPointPropertyInfo.
The StylusPointPropertyInfo for the specified StylusPointProperty.
The following example demonstrates how to get the information about a property from a StylusPointDescription. This example assumes that the StylusMove event has been connected to the event handler below.
void inkCanvas1_StylusMove(object sender, StylusEventArgs e)
{
StylusPointCollection points = e.GetStylusPoints(inkCanvas1);
StylusPointDescription description = points.Description;
StringWriter normalPressureInfo = new StringWriter();
if (description.HasProperty(StylusPointProperties.NormalPressure))
{
StylusPointPropertyInfo propertyInfo =
description.GetPropertyInfo(StylusPointProperties.NormalPressure);
normalPressureInfo.WriteLine(" Guid = {0}", propertyInfo.Id.ToString());
normalPressureInfo.Write(" Min = {0}", propertyInfo.Minimum.ToString());
normalPressureInfo.Write(" Max = {0}", propertyInfo.Maximum.ToString());
normalPressureInfo.Write(" Unit = {0}", propertyInfo.Unit.ToString());
normalPressureInfo.WriteLine(" Res = {0}", propertyInfo.Resolution.ToString());
}
}
Private Sub inkCanvas1_StylusMove(ByVal sender As Object, ByVal e As StylusEventArgs)
Dim points As StylusPointCollection = e.GetStylusPoints(inkCanvas1)
Dim description As StylusPointDescription = points.Description
Dim normalPressureInfo As New StringWriter()
If description.HasProperty(StylusPointProperties.NormalPressure) Then
Dim propertyInfo As StylusPointPropertyInfo = _
description.GetPropertyInfo(StylusPointProperties.NormalPressure)
normalPressureInfo.WriteLine(" Guid = {0}", propertyInfo.Id.ToString())
normalPressureInfo.Write(" Min = {0}", propertyInfo.Minimum.ToString())
normalPressureInfo.Write(" Max = {0}", propertyInfo.Maximum.ToString())
normalPressureInfo.Write(" Unit = {0}", propertyInfo.Unit.ToString())
normalPressureInfo.WriteLine(" Res = {0}", propertyInfo.Resolution.ToString())
End If
End Sub
Produkt | Versioner |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
Feedback om .NET
.NET är ett öppen källkod projekt. Välj en länk för att ge feedback: