GlyphRun.GetDistanceFromCaretCharacterHit Method (CharacterHit)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Retrieves the offset from the leading edge of the GlyphRun to the leading or trailing edge of a caret stop containing the specified character hit.

Namespace:   System.Windows.Media
Assembly:  PresentationCore (in PresentationCore.dll)

public double GetDistanceFromCaretCharacterHit(
	CharacterHit characterHit
)

Parameters

characterHit
Type: System.Windows.Media.TextFormatting.CharacterHit

The CharacterHit to use for computing the offset.

Return Value

Type: System.Double

A Double that represents the offset from the leading edge of the GlyphRun to the leading or trailing edge of a caret stop containing the character hit.

Exception Condition
ArgumentOutOfRangeException

The character hit is outside the range specified by the GlyphRun Unicode string.

If the GlyphRun is not hit testable, the distance of 0.0 is returned. Use the IsHitTestable property to determine if a GlyphRun can be hit test.

.NET Framework
Available since 3.0
Return to top
Show: