次の方法で共有


GetPacketValuesByProperty Method

GetPacketValuesByProperty Method

Returns the data for a known packet property from one or more packets in the stroke.

Declaration

[C++]

HRESULT GetPacketValuesByProperty (
    [in] BSTR propertyName,
    [in, optional, defaultvalue(ISC_FirstElement)] long startingIndex,
    [in, optional, defaultvalue(ISC_AllElements)] long pointCount,
    [out, retval] VARIANT* PacketValues
);

[Microsoft® Visual Basic® 6.0]

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

Parameters

propertyName

[in] The identifier from the PacketProperty constants that was used to select which packet data is retrieved.

For more information about the BSTR data type, see Using the Automation Library.

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 points that make up the stroke data. The default value ISC_AllElements, defined in the ItemSelectionConstants enumeration type, specifies all of the points that make up the stroke data.

PacketValues

[out, retval] Returns an array of signed 32-bit integers that specifies the value of the requested PacketProperty for each point requested from the stroke.

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

Return Value

HRESULT value Description
S_OK Success.
TPC_E_INVALID_STROKE The stroke is invalid.
E_POINTER A parameter contained an invalid pointer.
E_FAIL An unspecified error occurred.
E_OUTOFMEMORY Cannot allocate packet data array.
E_INVALIDARG Invalid index, count, or packet property.
E_INK_EXCEPTION An exception occurred inside the method.
CO_E_CLASSSTRING Invalid GUID format.

Remarks

A specific packet property may not be available on a particular IInkStrokeDisp object. A Tablet PC may have more than one tablet for user input. The InkTablets collection contains a list of all the tablets attached to the Tablet PC. Use the IsPacketPropertySupported method to determine if a particular packet property is supported by a specific IInkTablet object or by all the available tablets. Also, use the DesiredPacketDescription property of the ink collector to control which packet properties are collected on new strokes.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example gets the ButtonPressure (a Guid string defined in module InkConstants.bas) for every point in the IInkStrokeDisp, theStroke.

Dim theButtonPressureData() As Long
theButtonPressureData = _
    theStroke.GetPacketValuesByProperty(ButtonPressure)

Applies To