StrokeCollection.Add(StrokeCollection) Metodo

Definizione

Aggiunge i tratti specificati all'oggetto 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)

Parametri

strokes
StrokeCollection

Oggetto StrokeCollection da aggiungere alla raccolta.

Eccezioni

Un Stroke oggetto in strokes è già un membro dell'oggetto StrokeCollection.

strokes è null.

Esempio

Nell'esempio seguente viene illustrato come copiare l'input penna in un InkCanvas altro InkCanvas. In questo esempio si presuppone che:

  • Sono presenti due InkCanvas oggetti denominati inkCanvas1 e inkCanvas2.

  • L'evento Click è stato connesso al gestore eventi.

// 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

Commenti

Il Add metodo genera l'evento StrokesChanged .

Si applica a