Compartir a través de


DeleteStroke Method

DeleteStroke Method

Deletes a IInkStrokeDisp object from the InkDisp object.

Declaration

[C++]

HRESULT DeleteStroke (
    [in] IInkStrokeDisp* stroke
);

[Microsoft® Visual Basic® 6.0]

Public Sub DeleteStroke(stroke As IInkStrokeDisp)

Parameters

stroke

[in] Specifies the stroke to delete from the InkDisp object.

Return Value

HRESULT value Description
S_OK Success.
E_POINTER A parameter contained an invalid pointer.
E_FAIL An unspecified error occurred.
E_INK_MISMATCHED_INK_OBJECT The InkDisp object of the strokes must match the known InkDisp object.
E_INK_EXCEPTION An exception occurred inside the method.
E_UNEXPECTED Unexpected parameter or property type.

Remarks

This method deletes only a single stroke. To delete a collection of strokes, call the DeleteStrokes method.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 sample function deletes the strokes from the InkDisp object that have more points than countOfPoints and returns the number of deleted strokes.

        Public Function DeleteLongerStrokes(ByVal countOfPoints As Integer, _
ByRef theInk As InkDisp) As Integer
    Dim countOfDeletedStrokes As Integer
    Dim stroke As IInkStrokeDisp

    For Each stroke In theInk.Strokes
        If stroke.PacketCount > countOfPoints Then
            theInk.DeleteStroke stroke
            countOfDeletedStrokes = countOfDeletedStrokes + 1
        End If
    Next
    DeleteLongerStrokes = countOfDeletedStrokes
End Function
      

Applies To