How can I measure the Text Size in UWP Apps?

后端 未结 3 464
后悔当初
后悔当初 2020-12-14 19:50

In WPF, this was possible using FormattedText, like this:

private Size MeasureString(string candidate)
{
    var formattedText = new FormattedText(
        c         


        
3条回答
  •  孤城傲影
    2020-12-14 20:08

    If you are having issues in UWP with Size not resolving or working properly with double's. It is probably because you are using System.Drawing.Size.

    Use Windows.Foundation.Size instead.

提交回复
热议问题