共用方式為


RealTimeStylus.AsyncPluginCollection 屬性

取得 IStylusAsyncPlugin 外掛程式的集合,這些外掛程式會從 RealTimeStylus 物件接收手寫板畫筆資料。

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

語法

'宣告
Public ReadOnly Property AsyncPluginCollection As StylusAsyncPluginCollection
'用途
Dim instance As RealTimeStylus
Dim value As StylusAsyncPluginCollection

value = instance.AsyncPluginCollection
public StylusAsyncPluginCollection AsyncPluginCollection { get; }
public:
property StylusAsyncPluginCollection^ AsyncPluginCollection {
    StylusAsyncPluginCollection^ get ();
}
/** @property */
public StylusAsyncPluginCollection get_AsyncPluginCollection()
public function get AsyncPluginCollection () : StylusAsyncPluginCollection

屬性值

型別:Microsoft.StylusInput.StylusAsyncPluginCollection
IStylusAsyncPlugin 外掛程式的集合,這些外掛程式會從 RealTimeStylus 物件接收手寫板畫筆資料。

範例

這個 Microsoft Visual C# .NET 範例是表單之 Load (英文) 事件處理常式的程式碼片段,會建立 GestureRecognizerDynamicRenderer 及兩個 RealTimeStylus 物件,將物件附加至串聯的 RealTimeStylus 模型中,並且啟用動態轉譯、筆勢辨識,以及透過 RealTimeStylus 物件進行 Tablet 畫筆資料收集。GestureRecognizer 物件會設定為辨識單一筆劃筆勢,以及只辨識 Right、ChevronRight 和 ArrowRightApplicationGesture。主要 RealTimeStylus 物件的 WindowInputRectangle 屬性會明確設為使用已附加 RealTimeStylus 物件的整個控制項。表單本身會實作 IStylusAsyncPlugin 介面,並且附加至 RealTimeStylus 物件。

using Microsoft.Ink;
using Microsoft.StylusInput;
using Microsoft.StylusInput.PluginData;

// ...

// The panel where the tablet pen data is collected.
private System.Windows.Forms.Panel thePanel;

// 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 form's Load event handler.
private void theForm_Load(object sender, System.EventArgs e)
{
    // ...

    // Create a DynamicRenderer attached to the drawing area ,
    // and enable dynamic rendering.
    this.theDynamicRenderer = new DynamicRenderer(this.thePanel);
    this.theDynamicRenderer.Enabled = true;

    // Create a GestureRecognizer, and set it to recognize single-stroke gestures.
    this.theGestureRecognizer = new GestureRecognizer();
    this.theGestureRecognizer.MaxStrokeCount = 1;

    // Allow gesture recognition for specific gestures.
    this.theGestureRecognizer.EnableGestures( new ApplicationGesture[]
        {
            ApplicationGesture.Right,
            ApplicationGesture.ChevronRight,
            ApplicationGesture.ArrowRight
        } );

    // Enable gesture recognition.
    this.theGestureRecognizer.Enabled = true;

    // Create the primary and secondary RealTimeStylus objects.
    this.thePrimaryRealTimeStylus = new RealTimeStylus(this.thePanel);
    this.theSecondaryRealTimeStylus = new RealTimeStylus();

    // Add the secondary RealTimeStylus to the primary's asynchronous plug-in collection.
    this.thePrimaryRealTimeStylus.AsyncPluginCollection.Add(
        this.theSecondaryRealTimeStylus);

    // Add the dynamic renderer to the primary's synchronous plug-in collection.
    this.thePrimaryRealTimeStylus.SyncPluginCollection.Add(this.theDynamicRenderer);

    // Add the gesture recognizer to the secondary's synchronous plug-in collection.
    this.theSecondaryRealTimeStylus.SyncPluginCollection.Add(this.theGestureRecognizer);

    // Add the form to the secondary's asynchronous plug-in colleciton.
    this.theSecondaryRealTimeStylus.AsyncPluginCollection.Add(this);

    // Set the input rectangle to the entire panel for the RealTimeStylus.
    this.thePrimaryRealTimeStylus.WindowInputRectangle = new Rectangle(0,0,0,0);

    // Enable the RealTimeStylus, which allows notifications to flow to the plug-ins.
    this.thePrimaryRealTimeStylus.Enabled = true;

    // ...
}

平台

Windows Vista, Windows XP SP2, Windows Server 2003

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

版本資訊

.NET Framework

支援版本:3.0

請參閱

參考

RealTimeStylus 類別

RealTimeStylus 成員

Microsoft.StylusInput 命名空間