Share via


GetPacketDescriptionPropertyMetrics Method

GetPacketDescriptionPropertyMetrics Method

Returns the metrics for a given packet description type.

Declaration

[C++]

HRESULT GetPacketDescriptionPropertyMetrics (
    [in] BSTR id,
    [out] long* min,
    [out] long* max,
    [out] TabletPropertyMetricUnit* units,
    [out] float* resolution
);

[Microsoft® Visual Basic® 6.0]

Public Sub GetPacketDescriptionPropertyMetrics( _
    id As String, _
    min As Long, _
    max As Long, _
    units As TabletPropertyMetricUnit, _
    resolution As Single _
)

Parameters

id

[in] The globally unique identifier (GUID) from the PacketProperty constants that identifies the property for which to obtain metrics.

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

min

[out] The minimum value, in logical units, that the tablet reports for this property. For example, a tablet reporting x-values from 0 to 9000 would have a logical minimum of 0.

max

[out] The maximum value, in logical units, that the tablet reports for this property. For example, a tablet reporting x-values from 0 to 9000 would have a logical maximum of 9000.

units

[out] The physical units of the property, such as inches or degrees. For a list of property units, see the TabletPropertyMetricUnit enumeration type.

resolution

[out] The resolution or increment value for the units member. For example, a tablet that reports 400 dots per inch (dpi) would have a resolution value of 400.

Return Value

HRESULT value Description
S_OK Success.
E_POINTER A parameter contained an invalid pointer.
E_OUTOFMEMORY Cannot allocate memory necessary to complete this request.
CO_E_CLASSSTRING Invalid GUID format.
E_INVALIDARG The property does not exist in the collection.
E_INK_EXCEPTION An exception occurred while processing.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example gets the metrics for NormalPressure (a Guid string defined in module InkConstants.bas), from the IInkStrokeDisp, theStroke.

   Dim theMin As Long
    Dim theMax As Long
    Dim theUnits As TabletPropertyMetricUnit
    Dim theResolution As Single

    theStroke.GetPacketDescriptionPropertyMetrics _
        NormalPressure, theMin, theMax, theUnits, theResolution

Applies To