相关疑难解决方法(0)

与几何一起绘制文本的最佳方法是什么?

在WPF中,我开始使用LineGeometry,EllipseGeometry,GeometryGroup,Path等类来绘制2D图形.我选择了这些形状,因为我看到它可以更快,由于冻结功能.

我需要使用特定字体绘制文本和几何.文本需要使用与几何相同的坐标系来定位.我需要能够应用RotateTransform等变换.

什么是最好的方式?我遇到了GlyphRunDrawing类,但它真的很复杂.

非常感谢提前.

wpf geometry text draw

20
推荐指数
1
解决办法
1万
查看次数

在.NET Framework 4.6.2中,FormattedText()已废弃,我该如何修复它

当我尝试使用.net framework 4.6.2构建WPF项目时,我收到一个错误,因为FormattedText()已被废弃如下: [已废弃("使用PixelsPerDip覆盖",false)] public FormattedText(string textToFormat, CultureInfo culture,FlowDirection flowDirection,Typeface typeface,double emSize,Brush foreground);

新的覆盖方法是 public FormattedText(string textToFormat,CultureInfo culture,FlowDirection flowDirection,Typeface typeface,double emSize,Brush foreground,double pixelsPerDip);

问:如何确定pixelsPerDip?

问:如何使用没有pixelsPerDip?的旧构造函数,因为pixelsPerDip对我的项目没用.

c# wpf-controls .net-4.6.2

17
推荐指数
2
解决办法
6675
查看次数

标签 统计

.net-4.6.2 ×1

c# ×1

draw ×1

geometry ×1

text ×1

wpf ×1

wpf-controls ×1