2009-11-20 86 views
0

爲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。 請幫助理解該差異的原因並解決該問題。

+0

ClearType在服務器上啓用 – Denis 2009-11-20 07:22:42

回答

0

不太確定這是否會影響繪製位圖,但是您是否檢查過在服務器上啓用了ClearType?