Question : TranslateTransform and RotateTransform - Positioning correctly

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

Answer : TranslateTransform and RotateTransform - Positioning correctly

you cannot do like that indeed ...
http://www.experts-exchange.com/articles/Database/Miscellaneous/UPDATES-with-JOIN-for-everybody.html
mysql is unfortunately a bit limited in that regards, but you shall check out this:
1:
2:
3:
4:
5:
6:
7:
8:
9:
Update inv i
SET i.total = ( select SUM(v.quantity * s.charges)
          from invitem v
          JOIN service s
             ON s.idservice = v.idservice
          WHERE v.datetime = i.datetime
            AND v.invoiceid = i.id  --- < I presume this link condition is missing also ...
       )
WHERE i.datetime = @uniquekey
Random Solutions  
 
programming4us programming4us