StrokeCollection Class

Represents a collection of Stroke objects.

Namespace: System.Windows.Ink
Assembly: PresentationCore (in presentationcore.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

[TypeConverterAttribute(typeof(StrokeCollectionConverter))] 
public class StrokeCollection : Collection<Stroke>, INotifyPropertyChanged, INotifyCollectionChanged
/** @attribute TypeConverterAttribute(System.Windows.StrokeCollectionConverter) */ 
public class StrokeCollection extends Collection<Stroke> implements INotifyPropertyChanged, INotifyCollectionChanged
TypeConverterAttribute(System.Windows.StrokeCollectionConverter) 
public class StrokeCollection extends Collection<Stroke> implements INotifyPropertyChanged, INotifyCollectionChanged
<object>isfString</object>
<object StrokeCollection="isfString"/>

The StrokeCollection allows 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 allows, the StrokeCollection offers more options.

The following table lists where to learn how to manage 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();
    inkCanvas2.Strokes.Clear();
    inkCanvas2.Strokes.Add(strokes);

}

System.Object
   System.Collections.ObjectModel.Collection
    System.Windows.Ink.StrokeCollection

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 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show: