StrokeCollection.Clone 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
複製 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
傳回
StrokeCollection 的複本。
範例
下列範例示範如何將一個中的筆跡複製到另一 InkCanvas 個 InkCanvas 。 此範例假設:
// 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
備註
方法 Clone 會 Stroke 複製集合中的每個專案,而新的 StrokeCollection 會參考新的筆劃。