title: Printing high resolution with temporary Bitmap
body: <p>I want to print labels. If I draw to the printing contexts Graphics object, it works without problems. But if I use a temporary Bitmap all the drawn text is pixelated. I recognized that the resolution of the temp Bitmap and the printing Graphics object are different (96 dpi vs. 600 dpi). So I change the Bitmaps resolution to match the printing resolution. So all the drawn text is too big.</p>
  
  <p>I need the temporary Bitmap to rotate the image before printing.</p>
  
  <p>How to get this Bitmap correctly printed?</p>
  
  <p><strong>Pixalated code:</strong> (looks bad but has the temporary bitmap)</p>
  
  <pre><code>    // print event handler
      private void printPage(object sender, PrintPageEventArgs ev)
      {
          // size of the page
          Size s = Form1.getPixelFromCM(Properties.Settings.Default.LabelSize);
          // temporary bitmap object
          Bitmap bmp = new Bitmap(s.Width, s.Height);
          Graphics g = Graphics.FromImage(bmp);
          // draw text 
          labels[printLabelsIndex].PrintLabel(g);
          // draw the bitmap to the page
          ev.Graphics.DrawImage(bmp, 0, 0);
      }
  </code></pre>
  
  <p>This code produces this print:</p>
  
  <p><a href="https://i.stack.imgur.com/Bak0f.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Bak0f.png" alt="enter image description here"></a></p>
  
  <p><strong>High resolution code:</strong> (looks good but I need the temporary bitmap!)</p>
  
  <pre><code>    // print event handler
      private void printPage(object sender, PrintPageEventArgs ev)
      {
          // draw text directly to print context
          labels[printLabelsIndex].PrintLabel(ev.Graphics);
      }
  </code></pre>
  
  <p>This code produces this print:</p>
  
  <p><a href="https://i.stack.imgur.com/e8ZjG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/e8ZjG.png" alt="enter image description here"></a></p>