CreatePenDataEx
2.0
Creates a PENDATA
structure with specified OEM data subsets.
HPENDATA CreatePenDataEx( LPPENINFO lppeninfo,
UINT uScale, UINT fuOptions, UINT gmemFlags
)
Parameters
lppeninfo
Address of
tablet information to be inserted into the PENINFO
uScale
Data-scaling
metric value. This parameter can be one of the following values:
Constant |
Description |
PDTS_LOMETRIC |
Each
logical unit is mapped to 0.1 millimeter. Positive x is to the right;
positive y is down. |
PDTS_HIMETRIC |
Each
logical unit is mapped to 0.01 millimeter. Positive x is to the right;
positive y is down. |
PDTS_HIENGLISH |
Each
logical unit is mapped to 0.001 inch. Positive x is to the right; positive y
is down. |
PDTS_ARBITRARY |
The
application has done its own scaling of the data point. |
PDTS_STANDARDSCALE |
The standard
scaling metric is equivalent to PDTS_HIENGLISH. |
fuOptions
Storage and
trim options. If this parameter is 0, no timing, PDK_, or OEM data is stored.
If it is CPD_DEFAULT, everything but user data is stored.
Otherwise, this parameter can explicitly specify subsets of OEM and
other data. To do so, the parameter should be a combination of one of the
CPD_USER values that allocate extra storage and any collection of PHW_
constants. (These values should be combined using the bitwise-OR operator.)
The following table lists the PHW_ values for the fuOptions
parameter:
Constant |
Description |
PHW_PRESSURE |
Report
pressure in OEM data if available. |
PHW_HEIGHT |
Report
height in OEM data if available. |
PHW_ANGLEXY |
Report
XY-angle in OEM data if available. |
PHW_ANGLEZ |
Report
Z-angle in OEM data if available. |
PHW_BARRELROTATION |
Report
barrel rotation in OEM data if available. |
PHW_OEMSPECIFIC |
Report
OEM-specific value in OEM data if available. |
PHW_PDK |
Report
per-point PDK_ bits in OEM data. |
PHW_ALL |
Report all
available OEM data. This flag is the sum of all other PHW_ flags. The
following table lists the CPD_ values for the fuOptions parameter: |
CPD_DEFAULT |
Store
timing, PDK, and all OEM data for each stroke. |
CPD_USERBYTE |
Set
internal flag to add space for one byte of additional storage to be allocated
for each stroke. Added space is for application use. |
CPD_USERWORD |
Set
internal flag to add space for one word of additional storage to be allocated
for each stroke. Added space is for application use. |
CPD_USERDWORD |
Set
internal flag to add space for one doubleword of additional storage to be
allocated for each stroke. Added space is for application use. |
CPD_TIME |
Maintain
absolute time information for each stroke. |
gmemFlags
Flag that
specifies whether GlobalAlloc
Return Value
Returns the
handle to the HPENDATA object if successful; otherwise, returns NULL.
Comments
CreatePenDataEx is an extension of CreatePenData
The fuOptions
parameter is typically specified as CPD_DEFAULT to request collection and
storage of all information generated by the tablet, including x-y data, absolute
stroke timing information, and all available OEM data. The OEM data set that is
actually stored in the pen data is the minimum set that satisfies both the
request and what is physically available from the tablet (that is, intersection
set).
If lppeninfo
is NULL, and if there is no tablet on the system (that is, if the SendDriverMessage
function fails), the pen data that is created will not have any hardware or OEM
information and a default sampling rate of 100Hz will be used. This case is
similar to removing PENINFO
A value of 0
for fuOptions is used to indicate that only coordinate data is required.
While recognition of this type of pen data may suffer, this provides the least
complicated type of pen data.
PHW_ bits can
be specified to indicate which OEM values or per-point PDK_ pen state
information is to be collected. Note that, except for PHW_PDK, which is always
valid, this is only a request; if the hardware does not support certain types
of OEM data, that data will be absent.
The uScale
parameter specifies scaling values that are also used in the MetricScalePenData
See Also