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
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應