IRealTimeStylus::GetPacketDescriptionData method (rtscom.h)

Retrieves the packet properties and scaling factors.

Syntax

HRESULT GetPacketDescriptionData(
  [in]      TABLET_CONTEXT_ID tcid,
  [in, out] FLOAT             *pfInkToDeviceScaleX,
  [in, out] FLOAT             *pfInkToDeviceScaleY,
  [in, out] ULONG             *pcPacketProperties,
  [out]     PACKET_PROPERTY   **ppPacketProperties
);

Parameters

[in] tcid

Specifies the tablet context identifier.

[in, out] pfInkToDeviceScaleX

Specifies the conversion factor for the horizontal axis from ink space to digitizer coordinates.

[in, out] pfInkToDeviceScaleY

Specifies the conversion factor for the vertical axis from ink space to digitizer coordinates.

[in, out] pcPacketProperties

The number of properties in each packet.

[out] ppPacketProperties

Pointer to an array containing the GUIDs and property metrics for each packet property.

Return value

For a description of the return values, see RealTimeStylus Classes and Interfaces.

Remarks

You can pass NULL if you do not want the scaling parameters.

The IRealTimeStylus::GetPacketDescriptionData Method uses CoTaskMemAlloc to allocate space for ppPacketProperties. The caller should call CoTaskMemFree when the array is no longer needed.

The order of properties in the stream of data sent to plug-ins is the same as the order of the properties returned by IRealTimeStylus::GetPacketDescriptionData Method. Use this method to determine what the hardware is reporting versus what was requested when calling IRealTimeStylus::SetDesiredPacketDescription Method.

Examples

This C++ code example uses the IRealTimeStylus::GetPacketDescriptionData Method method to get information about the ink packet data.

STDMETHODIMP CCustomRenderer::StylusUp( 
            /* [in] */ IRealTimeStylus *piRtsSrc,
            /* [in] */ const StylusInfo *pStylusInfo,
            /* [in] */ ULONG cPropCountPerPkt,
            /* [size_is][in] */ LONG *pPacket,
            /* [out][in] */ LONG **ppInOutPkt)
{
TABLET_CONTEXT_ID *pTcids;
ULONG ulTcidCount;
TABLET_CONTEXT_ID tcid;
FLOAT fInkToDeviceScaleX;
FLOAT fInkToDeviceScaleY;
ULONG ulPacketProperties;
PACKET_PROPERTY *pPacketProperties;

// Get all the tablet context identifiers
HRESULT hr = piRtsSrc->GetAllTabletContextIds(&ulTcidCount, &pTcids);

// Use the first tablet context identifier in the array
tcid = *pTcids;

// Get the packet description data
hr = piRtsSrc->GetPacketDescriptionData(tcid, &fInkToDeviceScaleX, 
                                        &fInkToDeviceScaleY, &ulPacketProperties,
                                        &pPacketProperties);

// Use the packet description data to do things like scale the ink 
// to the physical display device when rendering your own strokes

	return S_OK;
}

Requirements

Requirement Value
Minimum supported client Windows XP Tablet PC Edition [desktop apps only]
Minimum supported server None supported
Target Platform Windows
Header rtscom.h
DLL RTSCom.dll

See also

IRealTimeStylus

IRealTimeStylus::GetDesiredPacketDescription Method

IRealTimeStylus::SetDesiredPacketDescription Method

RealTimeStylus Class