为ASP.NET网站呈现图表时,我使用Graphics.DrawString得到不同的结果。文字在开发环境上看起来不错,但在生产上大胆而丑陋。 生产图表样品is here。 我无法在开发环境中的图表示例上发布链接,但是我将其上载到名为GanttChartOnDevelopment.png的AmiProject网站上 我已检查安装在生产服务器上的所需字体。我使用 代码:使用Graphics.DrawString时的差异
FontFamily fontFamily = new FontFamily("Arial");
m_Font = new Font(fontFamily, 8, FontStyle.Regular);
m_Bitmap = new Bitmap(bitmapWidth, RowHeight * taskCount, PixelFormat.Format24bppRgb);
m_Bitmap.MakeTransparent(m_Bitmap.GetPixel(1, 1));
m_Graphics = Graphics.FromImage(m_Bitmap);
m_Graphics.SmoothingMode = SmoothingMode.AntiAlias;
m_Graphics.DrawString(Text, m_Font, new SolidBrush(Color.Black), new PointF(r.Right + 7, r.Top - 7));
我使用.NET 3.5。生产服务器是Windows 2008,开发 - Windows XP SP3。 请帮助理解该差异的原因并解决该问题。
ClearType在服务器上启用 – Denis 2009-11-20 07:22:42