Determine how wide a rendered character is in .NET

后端 未结 7 1366
Happy的楠姐
Happy的楠姐 2021-01-02 01:03

Lets say I render the character \"A\" to the screen with a size 14 font in Arial Regular. Is there a way in C# to calculate how many pixels wide it is?


The wa

7条回答
  •  -上瘾入骨i
    2021-01-02 01:58

    You don’t say how you “render” it, but if you have a string, you can use MeasureString too.

提交回复
热议问题