title: Strange rotation in C# graphics
body: <p>I am using OnPaint method in my class Class1 : Panel.</p>
  
  <pre><code>protected override void OnPaint(PaintEventArgs e)
  {
      base.OnPaint(e);
      Graphics g = e.Graphics; 
  }
  </code></pre>
  
  <p>to rotate and draw rectangle I am using </p>
  
  <pre><code>Matrix m = new Matrix();
  m.RotateAt(90, rotationPoint);
  g.Transform = m;
  g.FillRectangle(Brushes.Black, rectangle)
  </code></pre>
  
  <p>the problem is, that rotation isn't working as I want it to.</p>
  
  <p><img src="https://i.stack.imgur.com/RyQ5O.png" alt="http://i52.tinypic.com/2rca2ic.png"> </p>
  
  <p>Red square is rotation point and it's located in the middle-top of rectangle. How to set x, y and rotation point so rotation would work properly?</p>
  
  <p>After rotating at 90 degress it should look like this</p>
  
  <p><img src="https://i.stack.imgur.com/4Brot.png" alt="i53.tinypic.com/2co25wj.png"></p>
  
  <p>red pixel is still at the same location. </p>