Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Clone Method

StrokeCollection.Clone Method

Copies the StrokeCollection.

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

public virtual StrokeCollection Clone()

The Clone method copies each Stroke in the collection and the new StrokeCollection references the new strokes.

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

}

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft