المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : GraphicsPath.AddString vs Graphics.MeasureString



C# Programming
07-01-2009, 09:30 PM
hi

why does this fonction don't retrieve the same result as Graphics.MeasureString ?

public RectangleF MeasureString (string str,Font f)
{
using (GraphicsPath gp = new GraphicsPath())
{
gp.AddString(str,f.FontFamily,(int)f.Style,(300 / 72) * f.Size,new Point(0,0),new StringFormat()); // i'm using 300 dpi
return gp.GetBounds();
}
}