Export (0) Print
Expand All

IRealTimeStylus::GetPacketDescriptionData method

Applies to: desktop apps only

Retrieves the packet properties and scaling factors.


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


tcid [in]

Specifies the tablet context identifier.

pfInkToDeviceScaleX [in, out]

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

pfInkToDeviceScaleY [in, out]

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

pcPacketProperties [in, out]

The number of properties in each packet.

ppPacketProperties [out]

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.


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.


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)
ULONG ulTcidCount;
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,

// 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;


Minimum supported client

Windows XP Tablet PC Edition

Minimum supported server

None supported


RTSCom.h (also requires RTSCom_i.c)



See also

RealTimeStylus Class
IRealTimeStylus::GetDesiredPacketDescription Method
IRealTimeStylus::SetDesiredPacketDescription Method



Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Additions

© 2014 Microsoft