IDWriteTextLayout::HitTestPoint Method
The application calls this function passing in a specific pixel location relative to the top-left location of the layout box and obtains the information about the correspondent hit-test metrics of the text string where the hit-test has occurred. When the specified pixel location is outside the text string, the function sets the output value *isInside to FALSE.
Syntax
virtual HRESULT HitTestPoint(
FLOAT pointX,
FLOAT pointY,
[out] BOOL * isTrailingHit,
[out] BOOL * isInside,
[out] DWRITE_HIT_TEST_METRICS * hitTestMetrics
) = 0;
Parameter
pointX
The pixel location X to hit-test, relative to the top-left location of the layout box.pointY
The pixel location Y to hit-test, relative to the top-left location of the layout box.isTrailingHit [out]
An output flag that indicates whether the hit-test location is at the leading or the trailing side of the character. When the output *isInside value is set to FALSE, this value is set according to the output hitTestMetrics->textPosition value to represent the edge closest to the hit-test location.isInside [out]
An output flag that indicates whether the hit-test location is inside the text string. When FALSE, the position nearest the text's edge is returned.hitTestMetrics [out]
The output geometry fully enclosing the hit-test location. When the output *isInside value is set to FALSE, this structure represents the geometry enclosing the edge closest to the hit-test location.
Rückgabewert
Ist Methode erfolgreich, wird "S_OK" zurückgegeben. Andernfalls wird ein HRESULT-Fehlercode zurückgegeben.
Anforderungen
Mindestens unterstützter Client |
Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista |
Mindestens unterstützter Server |
Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 |
Header |
Dwrite.h |
Bibliothek |
Dwrite.lib |
DLL |
Dwrite.dll |