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 的副本。
示例
以下示例演示如何将墨迹中的墨迹复制到另一个 InkCanvasInkCanvas。 此示例假定:
// 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 引用新笔划。