DrawingAttributes.Clone 方法

定义

复制 DrawingAttributes 对象。

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

返回

DrawingAttributes

DrawingAttributes 对象的副本。

示例

以下示例演示如何复制 DrawingAttributes 对象。

void CopyAttributes(Stroke someStroke)
{
    DrawingAttributes attributes = new DrawingAttributes();
    attributes.Color = Colors.Red;
    someStroke.DrawingAttributes = attributes.Clone();
}
Sub CopyAttributes(ByVal someStroke As Stroke)
    Dim attributes As New DrawingAttributes()
    attributes.Color = Colors.Red
    someStroke.DrawingAttributes = attributes.Clone()
End Sub

注解

该方法 Clone 创建一个新 DrawingAttributes 对象,并使用与当前对象相同的值填充该对象。 还会复制任何自定义属性。

适用于

另请参阅