.net 如何将格式化文本字符串转换为基于几何体的对象?
如何将格式化文本字符串转换为基于几何体的对象 我不认为这个问题需要太多的解释,我也不认为我能给出很多其他细节 我只需要将格式化的文本转换成我可以在数学上(几何上)使用的东西.net 如何将格式化文本字符串转换为基于几何体的对象?,.net,wpf,.net-3.5,geometry,formatted-text,.net,Wpf,.net 3.5,Geometry,Formatted Text,如何将格式化文本字符串转换为基于几何体的对象 我不认为这个问题需要太多的解释,我也不认为我能给出很多其他细节 我只需要将格式化的文本转换成我可以在数学上(几何上)使用的东西 任何建议都将不胜感激 您可能正在寻找或;两个MSDN链接也都有常见的示例 基本使用模式如下所示: // Create sample formatted text. FormattedText formattedText = new FormattedText("Sample", CultureInfo.GetCult
任何建议都将不胜感激 您可能正在寻找或;两个MSDN链接也都有常见的示例 基本使用模式如下所示:
// Create sample formatted text.
FormattedText formattedText = new FormattedText("Sample",
CultureInfo.GetCultureInfo("en-us"), FlowDirection.LeftToRight,
new Typeface("Verdana"), 16, System.Windows.Media.Brushes.Black);
// Build geometry object that represents the text.
Geometry normalGeometry = formattedText.BuildGeometry(
new System.Windows.Point(0, 0));
// Build geometry object that represents the highlight bounding box of the text.
Geometry highLightGeometry = formattedText.BuildHighlightGeometry(
new System.Windows.Point(0, 0));