GestureAlternate.Id 屬性
取得發生之「應用程式筆勢」的唯一識別項。
命名空間: Microsoft.StylusInput.PluginData
組件: Microsoft.Ink (在 Microsoft.Ink.dll 中)
語法
'宣告
Public ReadOnly Property Id As ApplicationGesture
'用途
Dim instance As GestureAlternate
Dim value As ApplicationGesture
value = instance.Id
public ApplicationGesture Id { get; }
public:
property ApplicationGesture Id {
ApplicationGesture get ();
}
/** @property */
public ApplicationGesture get_Id()
public function get Id () : ApplicationGesture
屬性值
型別:Microsoft.Ink.ApplicationGesture
ApplicationGesture 列舉型別的成員,識別所發生的應用程式筆勢。
範例
這個 Microsoft Visual C# .NET 範例是程式碼片段,來自 IStylusAsyncPlugin 介面之 CustomStylusDataAdded 方法的實作。實作 IStylusAsyncPlugin 介面的表單包含 TextBox (英文) 物件 theTextBox。CustomStylusDataAdded 物件會檢查 GestureRecognizer 物件的自訂手寫筆資料,並顯示 GestureRecognizer 物件已辨識之任何筆勢的相關資訊。
using Microsoft.Ink;
using Microsoft.StylusInput;
using Microsoft.StylusInput.PluginData;
// ...
// Declare the RealTimeStylus objects, the GestureRecognizer plugin,
// and the DynamicRenderer plug-in.
private Microsoft.StylusInput.RealTimeStylus thePrimaryRealTimeStylus = null;
private Microsoft.StylusInput.RealTimeStylus theSecondaryRealTimeStylus = null;
private Microsoft.StylusInput.GestureRecognizer theGestureRecognizer = null;
private Microsoft.StylusInput.DynamicRenderer theDynamicRenderer = null;
// ...
// Informs the implementing object that user data is available.
public void CustomStylusDataAdded(RealTimeStylus sender, CustomStylusData data)
{
// We can identify the kind of custom data via either the Guid or Type.
// For the purpose of this demonstration we will validate both just to be safe.
// For other scenarios either approach is valid.
if (data.CustomDataId == GestureRecognizer.GestureRecognitionDataGuid)
{
// Cast the custom stylus data to gesture recognition data.
GestureRecognitionData theData = data.Data as GestureRecognitionData;
// If there is data in the notification, then display the information
// for all of the gestures recognized.
if (theData != null && theData.Count > 0)
{
this.theTextBox.Text = "GestureRecognitionData:" + Environment.NewLine;
foreach (GestureAlternate theGesture in theData)
{
this.theTextBox.Text += string.Format(
" Gesture {0,-10}, Confidence {1,-8}, Count {2}."
+ Environment.NewLine, theGesture.Id,
theGesture.Confidence, theGesture.StrokeCount);
}
this.theTextBox.Text += Environment.NewLine;
}
}
}
平台
Windows Vista, Windows XP SP2, Windows Server 2003
.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求。
版本資訊
.NET Framework
支援版本:3.0