初始化 DynamicRenderer 類別的新執行個體。
命名空間: Microsoft.StylusInput
組件: Microsoft.Ink (在 Microsoft.Ink.dll 中)
語法
'宣告
Public Sub New ( _
control As Control _
)
'用途
Dim control As Control
Dim instance As New DynamicRenderer(control)
public DynamicRenderer(
Control control
)
public:
DynamicRenderer(
Control^ control
)
public DynamicRenderer(
Control control
)
public function DynamicRenderer(
control : Control
)
參數
- control
型別:System.Windows.Forms.Control
顯示手寫板畫筆資料的控制項。
備註
雖然通常會使用相同的控制項 (英文) 或視窗控制代碼初始化 DynamicRenderer 和 RealTimeStylus 物件,但也可以使用不同的物件初始化這些物件。一個例子是當您想要在不是產生筆劃「封包」的視窗中呈現「筆墨」時,就可以這麼做。
範例
這個 C# 範例會示範表單之 Load (英文) 事件的事件處理常式,該表單會實作 IStylusAsyncPlugin 介面。接著會初始化 DynamicRenderer 物件的新執行個體 theDynamicRenderer 和 RealTimeStylus 物件的新執行個體 theRealTimeStylus,使其與表單相關聯,然後啟用這兩個執行個體。
using Microsoft.StylusInput;
// ...
private RealTimeStylus theRealTimeStylus;
private DynamicRenderer theDynamicRenderer;
// ...
private void InkCollection_Load(object sender, System.EventArgs e)
{
theDynamicRenderer = new DynamicRenderer(this);
theRealTimeStylus = new RealTimeStylus(this, true);
// Add the dynamic renderer to the synchronous plugin notification chain.
// Synchronous notifications occur on the pen thread.
theRealTimeStylus.SyncPluginCollection.Add(theDynamicRenderer);
// Add the form to the asynchronous plugin notification chain. This plugin
// will be used to collect stylus data into an ink object. Asynchronous
// notifications occur on the UI thread.
theRealTimeStylus.AsyncPluginCollection.Add(this);
// Enable the real time stylus and the dynamic renderer
theRealTimeStylus.Enabled = true;
theDynamicRenderer.Enabled = true;
}
這個 Microsoft Visual Basic .NET 範例會示範表單之 Load (英文) 事件的事件處理常式,該表單會實作 IStylusAsyncPlugin 介面。接著會初始化 DynamicRenderer 物件的新執行個體 theDynamicRenderer 和 RealTimeStylus 物件的新執行個體 theRealTimeStylus,使其與表單相關聯,然後啟用這兩個執行個體。
Imports Microsoft.StylusInput
' ...
Private theRealTimeStylus As RealTimeStylus
Private theDynamicRenderer As DynamicRenderer
' ...
Private Sub InkCollector_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles MyBase.Load
theDynamicRenderer = New DynamicRenderer(Me)
theRealTimeStylus = New RealTimeStylus(Me, True)
' Add the dynamic renderer to the synchronous plugin notification chain.
' Synchronous notifications occur on the pen thread.
theRealTimeStylus.SyncPluginCollection.Add(theDynamicRenderer)
' Add the form to the asynchronous plugin notification chain. This plugin
' will be used to collect stylus data into an ink object. Asynchronous
' notifications occur on the UI thread.
theRealTimeStylus.AsyncPluginCollection.Add(Me)
' Enable the real time stylus and the dynamic renderer
theRealTimeStylus.Enabled = True
theDynamicRenderer.Enabled = True
End Sub
平台
Windows Vista, Windows XP SP2, Windows Server 2003
.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求。
版本資訊
.NET Framework
支援版本:3.0