GetStrokeAttributes 

2.0     

Retrieves information about a stroke in an HPENDATA object.

int GetStrokeAttributes( HPENDATA hpndt, UINT iStrk, LPVOID lpvBuffer, UINT uOption )

Parameters

hpndt

Handle to the HPENDATA object, which must not be compressed.

iStrk

Zero-based stroke index. If there are no strokes in the pen data, an index of 0 can be used to retrieve the default attributes for the pen data. A value of IX_END specifies the last available stroke in the pen data.

lpvBuffer

Pointer to a structure whose type depends on uOption, or NULL if the uOption parameter does not require this buffer.

uOption

Specifies the attributes to retrieve. This parameter has one of the following values:

Constant

Description

GSA_DOWN

Retrieve the up/down state of the pen tip for this stroke. Returns 1 if the stroke is a down-stroke or 0 if it is an up-stroke. lpvBuffer is unused and ignored.

GSA_PENTIP

Retrieve the pen-tip characteristics (color, width, nib) used by the stroke specified by iStrk. lpvBuffer is a pointer to a PENTIP1AOCX_ structure. Return value is PDR_OK.

GSA_PENTIPCLASS

Retrieve the pen-tip characteristics (color, width, nib), if any, for the class of strokes of which the stroke specified by iStrk is a member. lpvBuffer is a pointer to a PENTIP1AOCX_ structure. Return value is PDR_OK.

GSA_RECTBOUND

Retrieve the bounding rectangle of the specified stroke. lpvBuffer is a pointer to a RECTEZENA2 structure. Return value is PDR_OK.

GSA_SELECT

Retrieve the selection status of the specified stroke. lpvBuffer is unused and ignored. Returns a nonzero value if the stroke is selected; otherwise, the return value is 0.

GSA_SIZE

Retrieve size of stroke in points and bytes. lpvBuffer is a pointer to a double-word value, or NULL. LOWORD(*(LPDWORD)lpvBuffer) is the size in points, and HIWORD(*(LPDWORD)lpvBuffer) is the size in bytes. Return value is PDR_OK.

GSA_TIME

Retrieve the absolute time of the stroke. lpvBuffer is a pointer to an ABSTIME1AOCV. structure; it cannot be NULL. The sec field specifies the number of seconds since Jan 1, 1970, and the ms field specifies the number of milliseconds offset from that time to the beginning of the stroke. Return value is PDR_OK.

GSA_USER

Retrieve the user value, if any, for the stroke. lpvBuffer is a pointer to a double-word value, or NULL. Returns the number of bytes of user data available in the stroke: 0, 1, 2, or 4.

GSA_USERCLASS

Retrieve the user value, if any, for the class of strokes of which the stroke specified by iStrk is a member. lpvBuffer is a pointer to a double-word value, or NULL. The return value is 4 because the user value in the strokes class table is a doubleword value.

 

Return Value

Returns PDR_OK or an integer value if successful, as described for the uOption parameter. If an error occurs, returns one of the following:

Constant

Description

PDR_COMPRESSED

Pen data is compressed.

PDR_ERROR

Parameter or other unspecified error.

PDR_MEMERR

Memory error.

PDR_PNDTERR

Invalid pen data.

PDR_STRKINDEXERR

Invalid stroke index.

PDR_TIMESTAMPERR

Timing information was removed.

PDR_VERSIONERR

Could not convert old pen data.

 

See Also

CreatePenDataEx, GetStrokeTableAttributes, SetStrokeAttributes, SetStrokeTableAttributes, PENTIP