📜  计算字符串长度与像素 c# 代码示例

📅  最后修改于: 2022-03-11 14:48:44.652000             🧑  作者: Mango

代码示例1
using (System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(new Bitmap(1, 1)))
{
    SizeF size = graphics.MeasureString("Hello there", new Font("Segoe UI", 11, FontStyle.Regular, GraphicsUnit.Point));
}