我需要将一个GDI字体转换为WPF "字体"。
特别地,我需要转换
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中以像素为单位...如何从一个转换到另一个?
PS.
根据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
myWpfLabel.FontSize = myDrawingFont.SizeInPoints / 72 * 96
。 - Clemens