This documentation is archived and is not being maintained.

StrokeCollection Class

Represents a collection of Stroke objects.

Namespace:  System.Windows.Ink
Assembly:  PresentationCore (in PresentationCore.dll)

public class StrokeCollection : Collection<Stroke>, 
	INotifyPropertyChanged, INotifyCollectionChanged
<object StrokeCollection="isfString"/>

XAML Values




A string that represents the stroke in base-64, encoded Ink Serialized Format (ISF).

The StrokeCollection enables you to perform functions such as hit testing, clipping, and erasing strokes. The InkCanvas control performs many of these functions, but if you need more control than the InkCanvas provides, the StrokeCollection offers more options.

The following table lists where to learn about managing digital ink on a custom control.

To do this…

See this article

Create a control that collects digital ink

Creating an Ink Input Control

Create a control that enables the user to select ink

How to: Select Ink from a Custom Control

Create a control that enables the user to point-erase ink

How to: Erase Ink on a Custom Control

The following example demonstrates how to copy the ink in one InkCanvas onto another InkCanvas. This example assumes:

  • There are two InkCanvas objects called inkCanvas1 and inkCanvas2.

  • The Click event has been connected to the event handler.

// Copy the strokes from one InkCanvas to another InkCanvas. 
private void CopyStrokes_Click(object sender, RoutedEventArgs e) 
    StrokeCollection strokes = inkCanvas1.Strokes.Clone();


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

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.

.NET Framework

Supported in: 3.5, 3.0