开发者

Scale text in WPF

开发者 https://www.devze.com 2023-03-16 07:46 出处:网络
How can I automatically scale text inside a control based on the control\'s size but always make sure it\'s readable 开发者_开发技巧(that is, I want the font size stays between 9pt and 30pt)The ViewBo

How can I automatically scale text inside a control based on the control's size but always make sure it's readable 开发者_开发技巧(that is, I want the font size stays between 9pt and 30pt)


The ViewBox can help with this, but I'm not sure about keeping the font size within a range. You can probably accomplish this roughly with MinHeight and MinWidth.


Try to use ScaleTransform. In order to understand how to calculate the scale size you may refer to http://social.msdn.microsoft.com/forums/en-US/wpf/thread/d73c9eb2-9c68-428d-b99b-d23d0c62c095/

0

精彩评论

暂无评论...
验证码 换一张
取 消