IStrokeBuilder::BeginStroke 方法 (rtscom.h)

使用 RealTimeStylus 类 对象的数据包数据开始墨迹对象上的笔划。

语法

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

参数

[in] tcid

平板电脑上下文标识符。

[in] sid

触笔标识符。

[in] pPacket

数据包数据的开始。 它是只读的。

[in] cPacketProperties

pPacketProperties 缓冲区中的 LONG 计数,即数据包数乘以属性数。

[in] pPacketProperties

包含数据包属性的缓冲区。

[in] fInkToDeviceScaleX

从墨迹空间到数字化器坐标的水平轴或 x 轴转换因子。

[in] fInkToDeviceScaleY

垂直轴从墨迹空间到数字化器坐标的垂直或 y 轴转换因子。

[in, out] ppIInkStroke

指向新笔划的指针。 此值可以为 NULL

返回值

有关返回值的说明,请参阅 RealTimeStylus 类和接口

注解

IStrokeBuilder::AppendPackets 方法和IStrokeBuilder::EndStroke 方法 结合使用。 IStrokeBuilder::BeginStroke 方法 开始生成笔划。 随着运动的继续和接收其他数据包, IStrokeBuilder::AppendPackets 方法 方法会添加该附加的笔划数据。 当平板电脑笔从表面抬起且不再有传入数据包时,将调用 IStrokeBuilder::EndStroke 方法

示例

以下 C++ 示例演示 IStylusPlugin 接口对象上的 IStylusPlugin::StylusDown 方法方法的实现。 该插件使用 StrokeBuilder 对象创建新的墨迹笔划。 从 IStylusPlugin::StylusDown方法调用 IStrokeBuilder::BeginStroke 方法,以启动笔划的构造。

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

要求

要求
最低受支持的客户端 Windows XP Tablet PC Edition [仅限桌面应用]
最低受支持的服务器 无受支持的版本
目标平台 Windows
标头 rtscom.h
DLL RTSCom.dll

另请参阅

DynamicRenderer 类

IStrokeBuilder

IStrokeBuilder::AppendPackets 方法

IStrokeBuilder::CreateStroke 方法

IStrokeBuilder::EndStroke 方法

StrokeBuilder 类