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
Colaborați cu noi pe GitHub
Sursa pentru acest conținut poate fi găsită pe GitHub, unde puteți, de asemenea, să creați și să consultați probleme și solicitări de tragere. Pentru mai multe informații, consultați ghidul nostru pentru colaboratori.
Feedback
https://aka.ms/ContentUserFeedback.
În curând: Pe parcursul anului 2024, vom elimina treptat Probleme legate de GitHub ca mecanism de feedback pentru conținut și îl vom înlocui cu un nou sistem de feedback. Pentru mai multe informații, consultați:Trimiteți și vizualizați feedback pentru