DynamicRenderer 构造函数 (Control)

初始化 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 或窗口句柄初始化 DynamicRendererRealTimeStylus 对象,但也可以使用不同的对象对它们进行初始化。例如,如果您希望在生成笔画数据包 的窗口以外的其他窗口呈现墨迹,就可以这么做。

示例

此 C# 示例演示实现 IStylusAsyncPlugin 接口的窗体的 Load 事件的事件处理程序。该处理程序初始化 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 示例演示实现 IStylusAsyncPlugin 接口的窗体的 Load 事件的事件处理程序。该处理程序初始化 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

另请参见

参考

DynamicRenderer 类

DynamicRenderer 成员

DynamicRenderer 重载

Microsoft.StylusInput 命名空间

IStylusAsyncPlugin