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 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈