DynamicRenderer.Refresh 方法

使 DynamicRenderer 对象重绘当前在其数据存储区中的墨迹数据。

命名空间:  Microsoft.StylusInput
程序集:  Microsoft.Ink(在 Microsoft.Ink.dll 中)

语法

声明
Public Sub Refresh
用法
Dim instance As DynamicRenderer

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

备注

如果 EnableDataCache 属性为 true,则 DynamicRenderer 对象将重绘尚未从缓存中释放的所有 Tablet 笔数据。如果 EnableDataCache 属性为 false,则 DynamicRenderer 对象仅重绘当前笔画。

在从 Paint 事件处理程序中调用 DynamicRenderer 对象的 Refresh 方法时,应将 DynamicRenderer 对象的 ClipRectangle 属性设置为 PaintEventArgs 对象的 ClipRectangle 属性。

如果已释放 DynamicRenderer 对象,则此方法将引发异常。

示例

此 C# 示例在 ControlPaint 事件内调用 DynamicRenderer 对象 theDynamicRenderer 的 Refresh 方法。如果窗口失效,则 DynamicRenderer 将重绘其数据缓存中的所有 Tablet 笔数据。有关 EnableDataCache 属性如何影响此操作的信息,请参见本主题的“备注”部分。

private void InkCollection_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
    // Refresh the dynamic renderer, since it's possible that a stroke is being
    // collected at the time Paint occurs.  In this case, the portion of the stroke
    // that has already been collected will need to be redrawn.
    theDynamicRenderer.ClipRectangle = e.ClipRectangle;
    theDynamicRenderer.Refresh();

    // ...
}

此 Microsoft Visual Basic .NET 示例在 ControlPaint 事件内调用 DynamicRenderer 对象 theDynamicRenderer 的 Refresh 方法。如果窗口失效,则 DynamicRenderer 将重绘其数据缓存中的所有 Tablet 笔数据。有关 EnableDataCache 属性如何影响此操作的信息,请参见本主题的“备注”部分。

Private Sub InkCollector_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) _
Handles MyBase.Paint
    ' Refresh the dynamic renderer, since it's possible that a stroke is being
    ' collected at the time Paint occurs.  In this case, the portion of the stroke
    ' that has already been collected will need to be redrawn.
    theDynamicRenderer.ClipRectangle = e.ClipRectangle
    theDynamicRenderer.Refresh()

    ' ...
End Sub

平台

Windows Vista, Windows XP SP2, Windows Server 2003

.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

DynamicRenderer 类

DynamicRenderer 成员

Microsoft.StylusInput 命名空间

DynamicRenderer.EnableDataCache

DynamicRenderer.ReleaseCachedData

DynamicRendererCachedData

其他资源

Dynamic-Renderer Plug-ins