IStrokeBuilder::BeginStroke method (rtscom.h)

Begins a stroke on an ink object by using packet data from a RealTimeStylus Class object.

Syntax

HRESULT BeginStroke(
  TABLET_CONTEXT_ID tcid,
  STYLUS_ID         sid,
  const LONG        *pPacket,
  ULONG             cPacketProperties,
  PACKET_PROPERTY   *pPacketProperties,
  FLOAT             fInkToDeviceScaleX,
  FLOAT             fInkToDeviceScaleY,
  IInkStrokeDisp    **ppIInkStroke
);

Parameters

tcid

The tablet context identifier.

sid

The stylus identifier.

pPacket

The start of the packet data. It is read-only.

cPacketProperties

The count of LONGs, which is the number of packets multiplied by the number of properties, in the pPacketProperties buffer.

pPacketProperties

The buffer containing the packet properties.

fInkToDeviceScaleX

The horizontal, or x-axis, conversion factor for the horizontal axis from ink space to digitizer coordinates.

fInkToDeviceScaleY

The vertical, or y-axis, conversion factor for the vertical axis from ink space to digitizer coordinates.

ppIInkStroke

A a pointer to the new stroke. This value can be NULL.

Return value

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

Remarks

Used in conjunction with the IStrokeBuilder::AppendPackets Method and IStrokeBuilder::EndStroke Method methods. IStrokeBuilder::BeginStroke Method starts building the stroke. As the motion continues and additional packets are received, the IStrokeBuilder::AppendPackets Method method adds that additional stroke data. When the tablet pen is raised from the surface and there are no more incoming packets, the IStrokeBuilder::EndStroke Method method is called.

Examples

The following C++ example shows the implementation of a IStylusPlugin::StylusDown Method method on an IStylusPlugin Interface object. The plug-in uses a StrokeBuilder object to create a new ink stroke. The IStrokeBuilder::BeginStroke Method method is called from IStylusPlugin::StylusDown Method to initiate the construction of a stroke.

STDMETHODIMP CStrokeBuilderPlugin::StylusDown( 
            /* [in] */ IRealTimeStylus *piRtsSrc,
            /* [in] */ const StylusInfo *pStylusInfo,
            /* [in] */ ULONG cPropCountPerPkt,
            /* [size_is][in] */ LONG *pPacket,
            /* [out][in] */ LONG **ppInOutPkt)
{
	FLOAT fInkToDeviceScaleX;
	FLOAT fInkToDeviceScaleY;
	ULONG cPacketProperties;
	PACKET_PROPERTY* pPacketProperties;

	// Get the info we need to call BeginStroke
	HRESULT hr = piRtsSrc->GetPacketDescriptionData(pStylusInfo->tcid, &fInkToDeviceScaleX, &fInkToDeviceScaleY, 
													&cPacketProperties, &pPacketProperties);

	if (SUCCEEDED(hr))
	{
		// Start creating the stroke
		hr = m_pStrokeBuilder->BeginStroke(pStylusInfo->tcid, pStylusInfo->cid, pPacket, cPropCountPerPkt, 
											pPacketProperties, fInkToDeviceScaleX, fInkToDeviceScaleY, &m_piStroke);
	}
	
	return hr;
}

Requirements

   
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

DynamicRenderer Class

IStrokeBuilder

IStrokeBuilder::AppendPackets Method

IStrokeBuilder::CreateStroke Method

IStrokeBuilder::EndStroke Method

StrokeBuilder Class