c#测量字体宽度

Bitmap image_size = new Bitmap(20 * count, f.Height);//初始化大小
Graphics size_g = Graphics.FromImage(image_size);
SizeF sizeF = size_g.MeasureString(number, f); 
sizeF就是测量的结果对象,可以获取到宽和高

猜你喜欢

转载自www.cnblogs.com/codeDevotee/p/11804907.html