public Form1()
        {
            InitializeComponent();
            Graphics gc = this.CreateGraphics();
            this.Show();
            gc.RotateTransform(50);            
            gc.DrawString("AAAA", new Font("MS Gothic", 9), Brushes.Black, 200, 10);
        }
不知道RotateTransform怎么用,希望高手指点一下,我想把字体逆时针旋转90度

解决方案 »

  1.   

    using System.Drawing;
    using System.Windows.Forms;class Test : Form
    {
      static void Main()
      {
        Application.Run(new Test());
      }
      
      protected override void OnPaint(PaintEventArgs e)
      {
        System.Drawing.Graphics g = e.Graphics;
        Rectangle r = new Rectangle(10, 10, 200, 200);
        g.TranslateTransform(10, 220);
        g.RotateTransform(270);
        g.DrawRectangle(new Pen(Color.Red, 1), r);
        g.DrawString("四度空间", new Font("宋体", 30), new SolidBrush(Color.Blue), r);
      }
    }
      

  2.   

    如果是要像古文那样竖排,则只需指定StringFormatFlags.DirectionVertical即可:
    using System.Drawing;
    using System.Windows.Forms;class Test : Form
    {
      static void Main()
      {
        Application.Run(new Test());
      }
      
      protected override void OnPaint(PaintEventArgs e)
      {
        e.Graphics.DrawString("四度空间", new Font("宋体", 30), Brushes.Blue,
          10, 10, new StringFormat(StringFormatFlags.DirectionVertical));
      }
    }