GlyphRun.GetCaretCharacterHitFromDistance(Double, Boolean) 方法

定義

擷取 CharacterHit 值,這個值表示 GlyphRun 之插入號 (Caret) 的字元點擊。

public:
 System::Windows::Media::TextFormatting::CharacterHit GetCaretCharacterHitFromDistance(double distance, [Runtime::InteropServices::Out] bool % isInside);
public System.Windows.Media.TextFormatting.CharacterHit GetCaretCharacterHitFromDistance (double distance, out bool isInside);
member this.GetCaretCharacterHitFromDistance : double * bool -> System.Windows.Media.TextFormatting.CharacterHit
Public Function GetCaretCharacterHitFromDistance (distance As Double, ByRef isInside As Boolean) As CharacterHit

參數

distance
Double

用於計算插入號字元點擊的位移 (Offset)。

isInside
Boolean

判斷字元點擊是否在 GlyphRun 中。

傳回

CharacterHit 值,表示最接近 distance 值的字元點擊。 如果字元點擊位於 GlyphRun,out 參數 isInside 會傳回 true,否則傳回 false

備註

distance 代表 的前置邊緣 GlyphRun 的位移。

如果點擊位於 之外 GlyphRun ,則字元點擊代表 內最接近的 GlyphRun 插入號字元點擊。

結構 CharacterHit 代表 內 GlyphRun 之字元點擊的相關資訊 - 已叫用之第一個字元的索引,以及前置或尾端邊緣的相關資訊。

適用於