简体   繁体   中英

Difference when using Graphics.DrawString

I get different result using Graphics.DrawString when rendering a chart for ASP.NET website. Text looks fine on development environment but bold and ugly on production. Chart sample on production is here . I can not post the link on chart sample from development environment, but I uploaded it on AmiProject website with name GanttChartOnDevelopment.png I have checked that required font in installed on production server. Code I am using:

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));

I am using .net 3.5. Production server is Windows 2008, Development - Windows XP SP3. Please help to understand the reason of that difference and fix that.

不太确定这是否会与位图绘图有所不同,但是您是否已检查服务器上是否启用了ClearType?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM