As with all matrix operations things are best done around the origin.
You can rotate around any point drawing the text at a position that orients
it correctly.
For example...
Matrix mx=new Matrix(1,0,0,1,0,0);
mx.Rotate(45,MatrixOrder.Append);
mx.Translate(this.ClientRectangle.Width/2,
this.ClientRectangle.Height/2,MatrixOrder.Append);
e.Graphics.Transform=mx;
SizeF sz=e.Graphics.MeasureString("Hello
World!!",this.Font,1024,StringFormat.GenericTypographic);
e.Graphics.DrawString("Hello
World!!",this.Font,Brushes.Black,-sz.Width/2,-sz.Height/2,StringFormat.GenericTypographic);
return;
--
Bob Powell [MVP]
Visual C#, System.Drawing
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.