StrokeCollection.Clone Metodo

Definizione

Copia l'oggetto StrokeCollection.

public:
 virtual System::Windows::Ink::StrokeCollection ^ Clone();
public virtual System.Windows.Ink.StrokeCollection Clone();
abstract member Clone : unit -> System.Windows.Ink.StrokeCollection
override this.Clone : unit -> System.Windows.Ink.StrokeCollection
Public Overridable Function Clone () As StrokeCollection

Valori restituiti

Copia dell'oggetto StrokeCollection.

Esempio

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

  • Esistono 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 Clone metodo copia ogni Stroke elemento nell'insieme e il nuovo StrokeCollection fa riferimento ai nuovi tratti.

Si applica a