FontMenuForm 基类见:http://blog.youkuaiyun.com/u013384702/article/details/17884617
Code:
using System;
using System.Drawing;
using System.Windows.Forms;
namespace CsStudy
{
class RotatedFont : FontMenuForm
{
const int iDegrees = 20;//旋转20°
public new static void Main()
{
Application.Run(new RotatedFont());
}
public RotatedFont()
{
Text = "Rotated Font";
strText = " 猪 爷 爷";
font = new Font("Arial",18);
}
protected override void DoPage(System.Drawing.Graphics grph, System.Drawing.Color clr, int cx, int cy)
{
Brush brush = new SolidBrush(clr);
StringFormat strfmt = new StringFormat();
strfmt.LineAlignment = StringAlignment.Center;
grph.TranslateTransform(cx/2,cy/2);
for (int i = 0; i < 360; i +=iDegrees)
{
grph.DrawString(strText,font,brush,0,0,strfmt);
grph.RotateTransform(iDegrees);//旋转
}
}
}
}
效果图: