title: When I print bitmap, it eats up some of it
body: <p>In my application i have a chart which is surrounded inside a panel. I added a printdocument component from the toolbox and when i want to print the chart, i am creating a bitmap and i get the panel inside the bitmap (and as a result the chart which is inside the panel). My problem is that when i create the bitmap, when i send it to the printer to print it, it eats up some of the chart from the bottom and from the right side. Below is my code to execute this</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
      {
          PrintDialog printDialog = new PrintDialog();
          printDialog.Document = printDocument1;
          printDialog.UseEXDialog = true;
          //Get the document
  
          if (DialogResult.OK == printDialog.ShowDialog())
          {
              printDocument1.DocumentName = "Test Page Print";
              printPreviewDialog1.Document = printDocument1;
  
              if (DialogResult.OK == printPreviewDialog1.ShowDialog())
              printDocument1.Print();
          }
      }
  </code></pre>
  
  <p>This is the button to initialize the print_document. (I added a print preview so that i don't have to print it every time and spent paper and ink)</p>
  
  <pre><code>private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
      {
          Bitmap bm = new Bitmap(this.panel1.Width, this.panel1.Height);
          this.panel1.DrawToBitmap(bm, new Rectangle(50, 50, this.panel1.Width + 50, this.panel1.Height + 50));
          e.Graphics.DrawImage(bm, 0, 0);
      }
  </code></pre>
  
  <p>I was thinking that maybe the chart is too big and it doesn't fit in the page but if i save the bitmap. it fits OK inside the page actually there is too much free space on the bottom and right side. (After the draw to bitmap function add</p>
  
  <pre><code>bm.Save(@"c:\LOAN_GRAPH.png");
  </code></pre>
  
  <p>instead of the draw image and the image is save in c:)</p>
  
  <p>Anybody who can help me i would be truly thankful.</p>