Share via


AddStroke Function

AddStroke Function

Adds an ink stroke to the recognizer context.

Syntax

[C++]

HRESULT WINAPI AddStroke(
  HRECOCONTEXT hrc,
  const PACKET_DESCRIPTION *pPacketDesc,
  ULONG cbPacket,
  const BYTE *pPacket,
  const XFORM *pxForm
);

Parameters

hrc

[in] Handle to the recognizer context.

pPacketDesc

[in] Describes the contents of the packets. The description must match the contents of the packets in pPacket. If NULL, this function uses the GetPreferredPacketDescription function.

cbPacket

[in] Size, in bytes, of the pPacket buffer.

pPacket

[in] Array of packets that contain tablet space coordinates.

pxForm

[in] Describes the transform to apply to ink to transform it from tablet space into ink space.

Return Value

HRESULT value Description
S_OK Success.
E_POINTER One of the parameters is an invalid pointer.
E_OUTOFMEMORY Unable to allocate memory to complete the operation.
TPC_E_INVALID_PACKET_DESCRIPTION The packet description does not contain the necessary information for the packet to be considered valid. For example, it does not include a GUID_X or GUID_Y property.
E_FAIL An unspecified error occurred.

Remarks

The recognizer must return properties such as Baseline or HotPoint in ink space coordinates rather than tablet coordinates.

It is recommended that your recognizer place a limit on the number of strokes per context and/or the points allowed in a given stroke. Limit input to 1024 strokes per context and 32767 points per stroke.