MetricScalePenData
1.0 2.0
Converts pen
data points to one of the supported metric modes.
BOOL MetricScalePenData( HPENDATA hpndt,
UINT wPndtNew )
Parameters
hpndt
Handle to a
pen data object containing the points to be converted.
wPndtNew
Scaling
metric to be used with the data, as listed here:
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. This is equivalent to PDTS_STANDARDSCALE. |
PDTS_DISPLAY |
This
parameter scales the data, using DPtoTP |
Return Value
Returns TRUE
if successful, or FALSE if hpndt is in a compressed state or if the data
is not already in one of the metric modes such as PDTS_ARBITRARY.
Comments
The MetricScalePenData
function converts pen coordinates between metric and English standard
measurements. Metric units are 0.1 and 0.01 millimeter; English standard units
are 0.001 inch. These scaling metrics form the same mapping mode set in the
Windows function SetMapMode
MetricScalePenData allows an application to transform pen data to the
mapping mode set for a device context. This ensures that ink rendered in the
device context appears in the proper scale.
Note the
following caveats about MetricScalePenData:
Because of rounding errors,
scaling is not precisely reversible between mapping modes. Rounding errors can
also adversely affect recognition accuracy if the data is later given to a
recognizer. The problem arises when transforming the standard ink scale of HIENGLISH
to a scale of lower resolution, a transformation that loses some of the
original data. The lost data cannot be recovered, even if the coordinates are
converted back into HIENGLISH.
The scaling is not perfect and
results in numerous off-by-one discrepancies, visible when displaying the
scaled data.
Strictly
speaking, the PDTS_DISPLAY scaling type is not a metric scale. To use it, the
current scale of the data must be in PDTS_STANDARDSCALE units.
The effect of
this call is similar to that of using the TPtoDP
See Also