IStylusAsyncPlugin.CustomStylusDataAdded 方法
通知實作外掛程式 CustomStylusData 可供使用。
命名空間: Microsoft.StylusInput
組件: Microsoft.Ink (在 Microsoft.Ink.dll 中)
語法
'宣告
Sub CustomStylusDataAdded ( _
sender As RealTimeStylus, _
data As CustomStylusData _
)
'用途
Dim instance As IStylusAsyncPlugin
Dim sender As RealTimeStylus
Dim data As CustomStylusData
instance.CustomStylusDataAdded(sender, _
data)
void CustomStylusDataAdded(
RealTimeStylus sender,
CustomStylusData data
)
void CustomStylusDataAdded(
RealTimeStylus^ sender,
CustomStylusData^ data
)
void CustomStylusDataAdded(
RealTimeStylus sender,
CustomStylusData data
)
function CustomStylusDataAdded(
sender : RealTimeStylus,
data : CustomStylusData
)
參數
- sender
型別:Microsoft.StylusInput.RealTimeStylus
已傳送自訂資料的 RealTimeStylus 物件。
- data
型別:Microsoft.StylusInput.PluginData.CustomStylusData
由 RealTimeStylus 物件所傳送的 CustomStylusData 物件。
範例
這個 C# 範例摘錄自 RealTimeStylus Plug-in Sample。
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)
{
GestureRecognitionData grd = data.Data as GestureRecognitionData;
if (grd != null)
{
if (grd.Count > 0)
{
GestureAlternate ga = grd[0];
sbGesture.Text = "Gesture=" + ga.Id + ", Confidence=" + ga.Confidence;
}
}
}
}
這個 Microsoft Visual Basic .NET 範例摘錄自 RealTimeStylus Plug-in Sample。
Public Sub CustomStylusDataAdded(sender As RealTimeStylus, data As CustomStylusData)
Implements IStylusAsyncPlugin.CustomStylusDataAdded
' 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 Then
Dim grd As GestureRecognitionData = CType(data.Data, GestureRecognitionData)
If Not (grd Is Nothing) Then
If grd.Count > 0 Then
Dim ga As GestureAlternate = grd(0)
sbGesture.Text = "Gesture=" + ga.Id + ", Confidence=" + ga.Confidence
End If
End If
End If
End Sub 'CustomStylusDataAdded
平台
Windows Vista, Windows XP SP2, Windows Server 2003
.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求。
版本資訊
.NET Framework
支援版本:3.0