Stroke.Clone Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a deep copy of the existing Stroke object.
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
Returns
The new Stroke object.
Examples
The following example demonstrates how to get a copy of the current Stroke object.
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
Remarks
The properties of an object that is a deep copy of another object have the same values as the properties of the original object.
Applies to
Συνεργαστείτε μαζί μας στο GitHub
Μπορείτε να βρείτε την πηγή για αυτό το περιεχόμενο στο GitHub, όπου μπορείτε επίσης να δημιουργήσετε και να εξετάσετε ζητήματα και αιτήματα έλξης. Για περισσότερες πληροφορίες, ανατρέξτε στον οδηγό συνεργατών.