怎么得到一memo的字体高度
如何得到一memo的字体高度?
试了用memo1.font.height,但其值为负数,就算用绝对值也与实际不符,
如果用form1.font := memo1.font; 再用form1.canvas.TextHeight是可以得到,
有没有不借助其它组件的办法呢?
------解决方案--------------------
字体高度正值是单元高度,为0是让Windows自定决定需多高,为负是实际图形部分高度
------解决方案--------------------
The value of Height can be obtained from the point size using this formula:
Font.Height = -Font.Size * Font.PixelsPerInch / 72
When the Height property has a positive value, the Size property has a negative value. When the Size property has a positive value, the Height property has a negative value.
试了用memo1.font.height,但其值为负数,就算用绝对值也与实际不符,
如果用form1.font := memo1.font; 再用form1.canvas.TextHeight是可以得到,
有没有不借助其它组件的办法呢?
------解决方案--------------------
字体高度正值是单元高度,为0是让Windows自定决定需多高,为负是实际图形部分高度
------解决方案--------------------
The value of Height can be obtained from the point size using this formula:
Font.Height = -Font.Size * Font.PixelsPerInch / 72
When the Height property has a positive value, the Size property has a negative value. When the Size property has a positive value, the Height property has a negative value.