草庐IT

glyphTypeface

全部标签

c# - WPF 相当于 TextRenderer

我已经使用TextRenderer来测量字符串的长度,因此可以适本地调整控件的大小。WPF中是否有等效项,或者我可以简单地使用TextRendered.MeasureString? 最佳答案 谢谢Gishu,阅读您的链接,我想出了以下两个对我有用的东西://////Gettherequiredheightandwidthofthespecifiedtext.UsesFortammedText///publicstaticSizeMeasureTextSize(stringtext,FontFamilyfontFamily,FontS