CompactPenData
1.0 2.0
Compacts pen
data based on specified trim options.
Note This function
is provided for compatibility with version 1.0 of the Pen API and will not be
supported in future versions. Use TrimPenData232HBFD and CompressPenData instead.
HPENDATA CompactPenData( HPENDATA hpndt, UINT
fuTrim )
Parameters
hpndt
Handle to a
pen data object.
fuTrim
Data-trimming
options:
PDTT_DEFAULT
Reallocates
memory block to fit the data; does not trim the data. If you call CompactPenData
with this trim option and then call the GlobalSize
PDTT_ALL
Removes the PENINFO
PDTT_COLLINEAR
Removes
successive identical (coincident) points and collinear points from the pen
data. After the operation is performed, PDTS_NOCOLLINEAR is set in the wPndts
member of the PENDATAHEADER
PDTT_COMPRESS
Compresses
the data without losing any information. After the data has been compressed,
the compressed handle to the pen data can be passed as a parameter only to the
functions CompactPenData, GetPenDataInfo
PDTT_DECOMPRESS
Decompresses
the data. You can use this option with other trim options, including
PDTT_COMPRESS. In this case, decompression is performed first, followed by any
other trim options specified, and followed by recompression if PDTT_COMPRESS is
specified. Since the compression method used by CompactPenData does not
lose information, the data is completely restored.
PDTT_OEMDATA
Removes all
OEM data this is data other than
coordinates, such as pressure. This option does not affect delayed recognition
unless a recognizer is being used that expressly requires OEM data. For
example, signature recognizers often use pressure information.
PDTT_PENINFO
Removes the PENINFO
PDTT_UPPOINTS
Removes all
data from pen-up points (points collected when the pen is not in contact with
the tablet). This option has no effect on delayed recognition. This option is
not usually necessary because pen-up points are not a part of standard pen
data.
Return Value
If successful,
CompactPenData returns a handle to a pen data object; otherwise, it
returns NULL. CompactPenData may fail and return NULL in low-memory
situations if compression or decompression is requested.
Comments
The PDTS_
bits are set in the wPndts member of the PENDATAHEADER
See Also