在WPF中,我开始使用LineGeometry,EllipseGeometry,GeometryGroup,Path等类来绘制2D图形.我选择了这些形状,因为我看到它可以更快,由于冻结功能.
我需要使用特定字体绘制文本和几何.文本需要使用与几何相同的坐标系来定位.我需要能够应用RotateTransform等变换.
什么是最好的方式?我遇到了GlyphRunDrawing类,但它真的很复杂.
非常感谢提前.
当我尝试使用.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对我的项目没用.