下面的代码在字体大小像20一样大但我尝试过时很正常
Font font = new Font("Arial",6,FontStyle.Regular);
图片上的字体质量很低,请检查这张图片
即使字体很小,也请帮助我获得高质量的文本。
using (Bitmap bmp = new Bitmap(200, 300))
{
using (Graphics g = Graphics.FromImage(bmp))
{
g.TextRenderingHint = TextRenderingHint.AntiAlias;
var format= new StringFormat()
{
Alignment = StringAlignment.Center,
LineAlignment = StringAlignment.Far
};
g.Clear(Color.White);
Font font = new Font("Arial", 20,FontStyle.Regular);
g.DrawString("Hello World", font , Brushes.Black, 50, 50, format);
}
}