title: How to draw a rotated string as an image with System.Drawing?
body: <p>I am drawing strings to images. The size of the images is dynamic, or in other words, the images are as large as necessary to display the strings. To achieve that I am measuring the size with Graphics.MeasureString() before rendering the text with Graphics.DrawString().</p>
  
  <p>That's all fine till the point where rotation comes into play. Until now I am drawing the string to the bitmap and rotate the whole bitmap I get as an result.</p>
  
  <p>The problem is that I have a very limited color palette and no mixed colors. So I have to avoid any kind of antialiasing, which is only possible by using InterpolationMode.NearestNeighbor by rotating the text bitmap. While that makes sure no unwanted color is rendered the result is indeed very ugly (from the users point of view). </p>
  
  <p>My thought: it should be possible to draw the text to the bitmap by rotating it with Graphics.RotateTransform() and avoiding clipping, isn't it?</p>
  
  <p>Because I have to define the size of the image to draw on first, and because this size increases by rotating, I have no clue how to get this done.</p>
  
  <p>Any help is very appreciated!</p>