Visual Basic .NET Public Function Split( _
ByVal findex As Single _
) As Stroke
C# public Stroke Split(
Managed C++ public: Stroke* Split(
findex System.Single. The floating point index value that represents where to split the Stroke object.
Microsoft.Ink.Stroke. The new Stroke object that is created as a result of calling this method.
A floating point index is a float value that represents a location somewhere between two points in the stroke. As examples, if 0.0 is the first point in the stroke and 1.0 is the second point in the stroke, 0.5 is halfway between the first and second points. Similarly, a floating point index value of 37.25 represents a location that is 25 percent along the line between points 37 and 38 of the stroke.
When a Stroke is split, one portion of the stroke retains the Id property of the original Stroke object. The other portion of the Stroke becomes a new Stroke object with an Id property that is one greater than the highest existing Id property. If the original Stroke was in a Strokes collection (other than the Ink.Strokes), only the beginning portion remains in that collection.
This C# example splits a Stroke object, theStroke, in half and renders the second half green.
float halfIndex = 0.5f * theStroke.GetPoints().Length; Stroke endStroke = theStroke.Split(halfIndex); endStroke.DrawingAttributes.Color = Color.Green;
This Microsoft® Visual Basic® .NET example splits a Stroke object, theStroke, in half and renders the second half green.
Dim halfIndex As Single = theStroke.GetPoints().Length / 2 Dim endStroke As Stroke = theStroke.Split(halfIndex) endStroke.DrawingAttributes.Color = Color.Green
float halfIndex = 0.5f * theStrokes.GetPoints().Length; Stroke endStroke = theStrokes.Split(halfIndex); theStrokes.Add(endStroke);
Dim halfIndex As Single = theStrokes(0).GetPoints().Length / 2 Dim endStroke As Stroke = theStrokes(0).Split(halfIndex) theStrokes.Add(endStroke)