簡體   English   中英

使用Graphics.DrawString時的區別

[英]Difference when using Graphics.DrawString

呈現ASP.NET網站的圖表時,使用Graphics.DrawString獲得不同的結果。 文字在開發環境中看起來不錯,但在生產中卻大膽難看。 有關生產的圖表樣本在這里 我無法將鏈接發布到來自開發環境的圖表示例中,但是我將其以GanttChartOnDevelopment.png的名稱上傳到AmiProject網站上,我已經檢查了生產服務器上安裝的所需字體。 我正在使用的代碼:

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?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM