Share via


DynamicRenderer.Refresh Method

DynamicRenderer.Refresh Method

Causes the DynamicRenderer to refresh the data that it is currently rendering.

Definition

Visual Basic .NET Public Sub Refresh()
C# public void Refresh();
Managed C++ public: void Refresh();

Exceptions

COMException Leave Site:
ObjectDisposedException Leave Site: The DynamicRenderer object is disposed.

Remarks

Raises an exception if the RealTimeStylus object has already been disposed.

Examples

[C#]

This C# example calls the Refresh method of a DynamicRenderer object, theDynamicRenderer, within the Paint Leave Site event of a Control Leave Site. If the window is invalidated, then any strokes that the DynamicRenderer is drawing will be re-drawn. This is especially useful when EnableDataCache is set to true.

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

    // ...
}

[VB.NET]

This Microsoft® Visual Basic® .NET example calls the Refresh method of a DynamicRenderer object, theDynamicRenderer, within the Paint Leave Site event of a Control Leave Site. If the window is invalidated, then any strokes that the DynamicRenderer is drawing will be re-drawn. This is especially useful when EnableDataCache is set to True.

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.Refresh()

    ' ...
End Sub

See Also