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,Ma trixOrder.Appen d);
mx.Translate(th is.ClientRectan gle.Width/2,
this.ClientRect angle.Height/2,MatrixOrder.A ppend);
e.Graphics.Tran sform=mx;
SizeF sz=e.Graphics.M easureString("H ello
World!!",this.F ont,1024,String Format.GenericT ypographic);
e.Graphics.Draw String("Hello
World!!",this.F ont,Brushes.Bla ck,-sz.Width/2,-sz.Height/2,StringFormat. GenericTypograp hic);
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.
"Ken Allen" <ke******@sympa tico.ca> wrote in message
news:uF******** *******@TK2MSFT NGP12.phx.gbl.. .
Bob Powell [MVP] wrote: The GDI+ FAQ shows you how.
Yes, but I note in the sample output provided that the rotation of the
text appears to be around the upper left corner of the text 'frame'; is
there a convenient manner in which the rotation can occur based on the
centre left of the text 'frame', so that the text drawn at zero (0) and
180 degrees are aaligned?
-ken