Well, it's one of those things that my line of work never brought me into contact with, until I decided to enhance the looks of a chart.
Anyhow, the problem is, while I know how to use it, the trouble I have is figuring out by how many pixels it should be moved.
There is clearly a mathematical way (or a routine using code) to do this and that's what I am asking.
Two examples below:
g.DrawString("45 degrees", FONT_AXIS_LABEL, BRUSH_BLACK, new Point(500, 300)); g.RotateTransform(45); g.TranslateTransform(400, -265, System.Drawing.Drawing2D.MatrixOrder.Append); g.DrawString("45 degrees", FONT_AXIS_LABEL, BRUSH_BLACK, new Point(500, 300)); g.ResetTransform();
g.DrawString("45 degrees (2)", FONT_AXIS_LABEL, BRUSH_BLACK, new Point(700, 300)); g.RotateTransform(45); g.TranslateTransform(458, -407, System.Drawing.Drawing2D.MatrixOrder.Append); g.DrawString("45 degrees (2)", FONT_AXIS_LABEL, BRUSH_BLACK, new Point(700, 300)); g.ResetTransform();
My question basically is this:
I was using "trial and error" to make the tilted text land where I want it to be, how can I outright CALCULATE those numbers?
400, -265 and 458, -407
|