StrokeCollection.Add(StrokeCollection) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds the specified strokes to the StrokeCollection.
public:
void Add(System::Windows::Ink::StrokeCollection ^ strokes);
public void Add (System.Windows.Ink.StrokeCollection strokes);
override this.Add : System.Windows.Ink.StrokeCollection -> unit
Public Sub Add (strokes As StrokeCollection)
- strokes
- StrokeCollection
The StrokeCollection to add to the collection.
A Stroke in strokes
is already a member of the StrokeCollection.
strokes
is null
.
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
andinkCanvas2
.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);
}
' Copy the strokes from one InkCanvas to another InkCanvas.
Private Sub CopyStrokes_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
Dim strokes As StrokeCollection = inkCanvas1.Strokes.Clone()
inkCanvas2.Strokes.Clear()
inkCanvas2.Strokes.Add(strokes)
End Sub
The Add method raises the StrokesChanged event.
Product | Versions |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: