绘制字体
垂直绘制字体
protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); Graphics g = e.Graphics; //g.SmoothingMode = SmoothingMode.AntiAlias;//搞锯齿呈显 Brush greenBrush = new SolidBrush(Color.Green); Rectangle rectangle = new Rectangle(20, 30, 200, 300); string drawString = "注塑一课"; Font drawFont = new Font("Verdann", 14); StringFormat stringFormat = new StringFormat(); stringFormat.FormatFlags = StringFormatFlags.DirectionVertical; stringFormat.Alignment = StringAlignment.Center; g.DrawString(drawString, drawFont, greenBrush, rectangle, stringFormat); greenBrush.Dispose(); drawFont.Dispose(); stringFormat.Dispose(); }