共用方式為


GestureRecognizer.Reset 方法

清除 GestureRecognizer 物件中之前的「筆劃」資訊。

命名空間:  Microsoft.StylusInput
組件:  Microsoft.Ink (在 Microsoft.Ink.dll 中)

語法

'宣告
Public Sub Reset
'用途
Dim instance As GestureRecognizer

instance.Reset()
public void Reset()
public:
void Reset()
public void Reset()
public function Reset()

範例

這個 C# 範例是功能表項目之 Click (英文) 事件處理常式的程式碼片段。當使用者選取 MenuItem (英文) 物件 theMenuItemMultistroke 時,GestureRecognizer 物件 theGestureRecognizer 會辨識多個筆劃筆勢。當使用者清除 theMenuItemMultistroke 時,theGestureRecognizer 則會辨識單一筆劃筆勢。Reset 方法會清除 theGestureRecognizer 中的舊筆劃資訊。

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;

// ...

// The Multistroke menu item's Click event handler.
private void theMenuItemMultistroke_Click(object sender, System.EventArgs e)
{
    // Update the Multistroke menu item's checked state.
    this.theMenuItemMultistroke.Checked = !this.theMenuItemMultistroke.Checked;

    // Update the maximum stroke count for and reset gesture recognition. 
    this.theGestureRecognizer.MaxStrokeCount =
        (this.theMenuItemMultistroke.Checked) ? 2 : 1;
    this.theGestureRecognizer.Reset();
}

平台

Windows Vista, Windows XP SP2, Windows Server 2003

.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求

版本資訊

.NET Framework

支援版本:3.0

請參閱

參考

GestureRecognizer 類別

GestureRecognizer 成員

Microsoft.StylusInput 命名空間