GetPacketData Method

GetPacketData Method

Gets the packet data for a range of packets within the IInkStrokeDisp object.



HRESULT GetPacketData(
    [in, optional, defaultvalue(ISC_FirstElement)] long startingIndex,
    [in, optional, defaultvalue(ISC_AllElements)] long pointCount,
    [out, retval] VARIANT* PacketData

[Microsoft® Visual Basic® 6.0]

Public Function GetPacketData( _
    [startingIndex As Long], _
    [pointCount As Long = -1] _
) As Variant



[in, optional] The starting point of the zero-based index to a packet within the stroke. The default value ISC_FirstElement, defined in the ItemSelectionConstants enumeration type, specifies the first packet.


[in, optional] The number of point packet data sets that should be returned, starting with the packet specified in the startingIndex parameter. The default value ISC_AllElements, defined in the ItemSelectionConstants enumeration type, specifies all of the points that make up the stroke data.


[out, retval] Returns a signed 32-bit integer array containing the packet data for the requested points in the stroke. The array contains the data for the first point, then the data for the second point, and so on.

For more information about the VARIANT structure, see Using the Automation Library.

Return Value

HRESULT valueDescription
E_POINTERA parameter contained an invalid pointer.
E_FAILAn unspecified error occurred.
E_OUTOFMEMORYCannot allocate Stroke handler helper object.
E_INVALIDARGThe stroke is invalid.
E_INK_EXCEPTIONAn exception occurred inside the method.
E_UNEXPECTEDUnexpected parameter or property type.


If the number of packets in the stroke is less than the sum of the startingIndex and pointCount parameters, then the returned array of data contains packet information for fewer points than the count requested.

To retrieve the description of the packet data, use the stroke's PacketDescription property. This property returns an array of globally unique identifier (GUID) that indicate which property values are returned by the GetPacketData method for each point. The PacketProperty constants contain the available packet property GUIDs.


[Visual Basic 6.0]

This Visual Basic 6.0 example gets the packet data for only the first point in the IInkStrokeDisp, theStroke.

Dim thePacketData () As Long
thePacketData = theStroke.GetPacketData(0, 1)

Applies To

Related Topics