HRESULT Split ( [in] float index, [out, retval] IInkStrokeDisp **NewStroke );
[Microsoft® Visual Basic® 6.0]
Public Function Split( _ index As Single _ ) As IInkStrokeDisp
[in] The floating point index value that represents where to split the stroke.
[out] Returns the new IInkStrokeDisp object that is created from the split operation.
|E_POINTER||A parameter contained an invalid pointer.|
|E_OUTOFMEMORY||Cannot allocate Stroke handler helper object.|
|E_INVALIDARG||The parameter is invalid.|
|E_UNEXPECTED||Unexpected parameter or property type.|
|E_INK_EXCEPTION||An exception occurred inside the method.|
This method inserts the new stroke immediately after the original stroke in the stroke set and renumbers the remaining stroke indices.
When an IInkStrokeDisp is split, the beginning portion of the stroke remains the ID of the original IInkStrokeDisp. The end portion of the IInkStrokeDisp becomes a new IInkStrokeDisp with an ID that is one greater than the highest IInkStrokeDisp ID. If the original IInkStrokeDisp was in an InkStrokes collection (other than the Ink.Strokes), only the beginning portion remains in that collection. The following code shows how to add the end portion to that collection.
Dim endSegmentOfSplitStroke As IInkStrokeDisp Set endSegmentOfSplitStroke = Stroke.Split(splitIndex) theStrokes.Add endSegmentOfSplitStroke
[Visual Basic 6.0]
This Visual Basic 6.0 example splits an IInkStrokeDisp theStroke at the location specified by theSplitFIndex.
Dim theNewStroke As IInkStrokeDisp Set theNewStroke = theStroke.Split(theSplitFIndex)