【发布时间】:2012-03-30 20:10:48
【问题描述】:
我需要在 WPF“字体”中转换 GDI 字体。
myGdiFont As System.Drawing.Font
在
_Family As Windows.Media.FontFamily
_Style As Windows.FontStyle
_Weight As Windows.FontWeight
_Size As Double
特别是,我需要转换
_Size = myGdiFont.Size (???)
WinForms 字体中的大小是单位或点...在 WPF 中是像素...如何从一种转换为另一种?
附言。
按照 Clemens 的指示,是否正确?
Dim myDrawingFont As New System.Drawing.Font("Arial", 10)
Dim myWpfLabel As New Windows.Controls.Label
myWpfLabel.FontSize = myDrawingFont.SizeInPoints * 72 / 96
固定:
myWpfLabel.FontSize = myDrawingFont.SizeInPoints * 96 / 72
【问题讨论】:
标签: .net wpf winforms fonts font-size