Compartir a través de


GetPacketData Method

GetPacketData Method

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

Declaration

[C++]

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

Parameters

startingIndex

[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.

pointCount

[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.

PacketData

[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 value Description
S_OK Success.
E_POINTER A parameter contained an invalid pointer.
E_FAIL An unspecified error occurred.
E_OUTOFMEMORY Cannot allocate Stroke handler helper object.
E_INVALIDARG The stroke is invalid.
E_INK_EXCEPTION An exception occurred inside the method.
E_UNEXPECTED Unexpected parameter or property type.

Remarks

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.

Example

[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