Share via


DynamicRenderer.Refresh Method

Causes the DynamicRenderer object to redraw the ink data that is currently in its data store.

Namespace:  Microsoft.StylusInput
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

Syntax

'Declaration
Public Sub Refresh
'Usage
Dim instance As DynamicRenderer

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

Remarks

If the EnableDataCache property is true, then the DynamicRenderer object redraws all tablet pen data not yet released from the cache. If the EnableDataCache property is false, then the DynamicRenderer object redraws only the current stroke.

When calling the DynamicRenderer object's Refresh method from within a Paint event handler, set the DynamicRenderer object's ClipRectangle property to the PaintEventArgs object's ClipRectangle property.

This method raises an exception if the DynamicRenderer object has already been disposed.

Examples

This C# example calls the Refresh method of a DynamicRenderer object, theDynamicRenderer, within the Paint event of a Control. If the window is invalidated, the DynamicRenderer redraws any tablet pen data in its data cache. For information about how this operation is affected by the EnableDataCache property, see the Remarks section of this topic.

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();

    // ...
}

This Microsoft Visual Basic .NET example calls the Refresh method of a DynamicRenderer object, theDynamicRenderer, within the Paint event of a Control. If the window is invalidated, the DynamicRenderer redraws any tablet pen data in its data cache. For information about how this operation is affected by the EnableDataCache property, see the Remarks section of this topic.

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

Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

DynamicRenderer Class

DynamicRenderer Members

Microsoft.StylusInput Namespace

DynamicRenderer.EnableDataCache

DynamicRenderer.ReleaseCachedData

DynamicRendererCachedData

Other Resources

Dynamic-Renderer Plug-ins