Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 获取给定点处格式化文本中符号的索引_C#_.net_Wpf - Fatal编程技术网

C# 获取给定点处格式化文本中符号的索引

C# 获取给定点处格式化文本中符号的索引,c#,.net,wpf,C#,.net,Wpf,我们有格式化的文本对象,坐标x,y(点) 如何通过该坐标找到文本中符号的索引 有没有一种方法可以快速找到FormattedText中每个字符的矩形?我找到了一种缓慢的方法:例如,第5个字符的矩形是FormattedText.BuildHighlightGeometry(new Point(),5,1).Bounds;

我们有格式化的文本对象,坐标x,y(点)

如何通过该坐标找到文本中符号的索引


有没有一种方法可以快速找到FormattedText中每个字符的矩形?

我找到了一种缓慢的方法:例如,第5个字符的矩形是FormattedText.BuildHighlightGeometry(new Point(),5,1).Bounds;