StylusPointDescription.GetPropertyInfo(StylusPointProperty) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得所指定屬性的 StylusPointPropertyInfo。
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
StylusPointProperty,指定所需 StylusPointPropertyInfo 的屬性。
傳回
所指定 StylusPointPropertyInfo 的 StylusPointProperty。
範例
下列範例示範如何從 StylusPointDescription取得屬性的相關信息。 此範例假設 StylusMove 事件已連線到下面的事件處理程式。
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