Graphics.DrawString字体在Windows 7中变为粗体 [英] Graphics.DrawString fonts are coming bold in Windows 7

查看:413
本文介绍了Graphics.DrawString字体在Windows 7中变为粗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即使我在DrawString方法中提到了Font ("Arial", 9, FontStyle.Regular),字体在Windows 7中也以粗体显示.但是在Windows XP中,它却可以正常显示.

Even though I mention Font ("Arial", 9, FontStyle.Regular) in DrawString method, font is coming as bold in Windows 7. But in Windows XP it is coming alright.

Dim printFont1 As New Font("Arial", 9, FontStyle.Regular)
Dim myBrush As New SolidBrush(Color.Black)
Dim bm1 As New Bitmap(PictureBox5.Width, PictureBox5.Height, PixelFormat.Format32bppPArgb)
Dim gr1 As Graphics = Graphics.FromImage(bm1)
  
gr1.DrawString("Hello:", printFont1, myBrush, x, y)





Any help will be highly appreciated

推荐答案

Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;

我认为这可以解决您的问题:)
Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;

I think this will solve your problem :)


这篇关于Graphics.DrawString字体在Windows 7中变为粗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆