简体   繁体   中英

Clear type font usage in C#/VB.NET

如何在C#/ VB.NET中使用ClearType字体?

protected override void OnPaint(PaintEventArgs e)
{
    e.Graphics.DrawString("Normal style", this.Font, Brushes.Black, 50, 50);

    e.Graphics.TextRenderingHint =
         System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;

    e.Graphics.DrawString("ClearType style", this.Font, Brushes.Black, 50, 100);
}

另外,要将平滑方法设置为“标准”,请使用:

e.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAliasGridFit

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