pe.Graphics.RotateTransform (_angle);

解决方案 »

  1.   

    private void OnPaint(object sender, System.Windows.Forms.PaintEventArgs e)
    {
    e.Graphics.FillRectangle(Brushes.White, e.ClipRectangle); Font f = new Font ("Arial", 10); // Move the origin to the middle of the window:
    System.Drawing.Size sz = TextArea.Size;
    Point Middle = new Point (sz.Width / 2, sz.Height / 2);
    e.Graphics.TranslateTransform (Middle.X, Middle.Y);
    // Apply all transforms.... e.Graphics.RotateTransform (_angle);
    // Create a new StringFormat object to 
    StringFormat format = new StringFormat (StringFormatFlags.NoClip);
    format.Alignment = StringAlignment.Center;
    format.LineAlignment = StringAlignment.Center;
    e.Graphics.DrawString ("A simple TextString ", f, Brushes.Black, 0, 0, 
    format);
    }