Loading

绘制文字

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

  

posted @ 2021-06-19 17:04  jevan  阅读(33)  评论(0编辑  收藏  举报