绘制文字
protected override void OnPaint(PaintEventArgs e) { base.OnPaint (e); FontFamily fontFamily = new FontFamily("Times New Roman"); Font font = new Font( fontFamily, 32, FontStyle.Regular, GraphicsUnit.Pixel); SolidBrush solidBrush = new SolidBrush(Color.FromArgb(255, 202, 0, 255)); string string1 = "SingleBitPerPixel"; string string2 = "AntiAlias"; e.Graphics.TextRenderingHint = TextRenderingHint.SingleBitPerPixel; e.Graphics.DrawString(string1, font, solidBrush, new PointF(10, 10)); e.Graphics.TextRenderingHint = TextRenderingHint.AntiAlias; e.Graphics.DrawString(string2, font, solidBrush, new PointF(10, 60)); }
本文来自博客园,作者:jevan,转载请注明原文链接:https://www.cnblogs.com/DoNetCShap/p/14903519.html