IDWriteTextLayout.HitTestPoint

<summary> Given a coordinate (in DIPs) relative to the top-left of the layout box, this returns the corresponding hit-test metrics of the text string where the hit-test has occurred. This is useful for mapping mouse clicks to caret positions. When the given coordinate is outside the text string, the function sets the output value *isInside to false but returns the nearest character position. </summary> <param name="pointX">X coordinate to hit-test, relative to the top-left location of the layout box.</param> <param name="pointY">Y coordinate to hit-test, relative to the top-left location of the layout box.</param> <param name="isTrailingHit">Output flag indicating 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 *position value to represent the edge closest to the hit-test location. </param> <param name="isInside">Output flag indicating whether the hit-test location is inside the text string. When false, the position nearest the text's edge is returned.</param> <param name="hitTestMetrics">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.</param> <returns> Standard HRESULT error code. </returns>

interface IDWriteTextLayout
extern (Windows)
HRESULT
HitTestPoint

Meta