言語

Stroke.Clone メソッド

定義

既存の Stroke オブジェクトのディープ コピーを返します。

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

返品

新しい Stroke オブジェクトです。

次の例では、現在の Stroke オブジェクトのコピーを取得する方法を示します。



Stroke GetLittleRedStroke(Stroke theStroke)
{
    // Copy the incoming stroke
    Stroke sCopy = theStroke.Clone();

    // Scale it by 50%
    Matrix xform = new Matrix();
    xform.Scale(0.5, 0.5);

    sCopy.Transform(xform, false);

    // Color it red
    sCopy.DrawingAttributes.Color = Colors.Red;

    // Return the new stroke
    return (sCopy);
}

Function GetLittleRedStroke(ByVal theStroke As Stroke) As Stroke
    ' Copy the incoming stroke
    Dim sCopy As Stroke = theStroke.Clone()

    ' Scale it by 50%
    Dim xform As New Matrix()
    xform.Scale(0.5, 0.5)

    sCopy.Transform(xform, False)

    ' Color it red
    sCopy.DrawingAttributes.Color = Colors.Red

    ' Return the new stroke
    Return sCopy

End Function 'getLittleRedStroke

注釈

別のオブジェクトのディープ コピーであるオブジェクトのプロパティは、元のオブジェクトのプロパティと同じ値を持ちます。

適用対象