用 DrawString 和 FillPath 写字时字体大小不同怎么办?
用 Graphics.DrawString 和 Graphics.FillPath 在界面显示字时,相同的字体,FillPath 要小很多,这个怎么办啊?
Graphics g = e.Graphics;
Rectangle rect = this.DisplayRectangle;
// 正常
g.DrawString(text, this.Font, new SolidBrush(Color.Red), rect);
// 相对DrawString要小很多
using (GraphicsPath path = new GraphicsPath())
{
path.AddString(text, base.Font.FontFamily, (int)base.Font.Style,
base.Font.SizeInPoints, rect,
new StringFormat(StringFormatFlags.DisplayFormatControl));
using (Brush lbs = new SolidBrush(Color.Green))
{
g.FillPath(lbs, path);
}