Determines if a given point lies on or near the pen-down strokes contained in
int HitTestPenData( HPENDATA hpndt, LPPOINT lppt, UINT dThresh, UINT FAR* lpiStrk, UINT FAR* lpiPnt )
Handle to the HPENDATA
does not alter the data in the HPENDATA
Address of a POINT
structure containing the point to test.
Threshold around the point given in lppt
. The point lies at the center of a square with sides of length dThresh
. If HitTestPenData
finds a point in the HPENDATA
object that lies in the square, it indicates a "hit." dThresh
must have the same scaling units as the points in the HPENDATA
or the result will not be correct. If dThresh
is 0, HitTestPenData
assumes a default threshold value of 3.
Stroke index from which to begin testing. After HitTestPenData
returns from a successful test, the variable that lpiStrk
points to contains the index of the hit stroke.
Point index from which to begin testing. After HitTestPenData
returns from a successful test, the variable that lpiPnt
points to contains the index of the hit point in the stroke indicated by lpiStrk
Returns one of the following if successful:
||The point hits (intersects) the pen data or falls within the provided
threshold around a particular point in the pen data as specified by the stroke and the
point indices. The stroke and point values are returned in lpiStrk and lpiPnt, respectively.
||The point does not hit (intersect) the pen data nor does it fall within the
provided threshold around a particular point in the pen data as specified by the
stroke and the point indices.
Otherwise, the function returns one of the following negative values:
||Pen data is compressed.
||Parameter or other unspecified error.
||Invalid pen data.
||Invalid point index.
||Invalid stroke index.
||Could not convert old pen data.
HitTestPenData checks whether the point specified by lppt
falls within the threshold specified by dThresh
around a point in the pen data, depending on the zero-based starting stroke
and point indices specified by lpiStrk
. This function tests only down strokes in the pen data. If lpiStrk
is greater than the number of strokes in the pen data, testing starts from
the first stroke.
Similarly, if lpiPnt
is greater than the number of points in the stroke, testing starts from the
first point in that stroke. The first point in the first stroke (from the
specified indices) that meets the test condition is returned via lpiPnt
In any case, HitTestPenData
accounts for the width of the ink trail. If the value given in dThresh
is less than the ink width, HitTestPenData
ignores the specified value of dThresh
and instead uses the ink width as the threshold.
does not consider pen-up strokes.
- Software for developers
Software for Android Developers
- More information resources
Unix Manual Pages