title: VB.NET Screen Capture
body: <p>Hello all i am using the below code to capture the screenshot of the black panel of my window form in visual basic 2005.</p>
  
  <p>My problem is that I want the red border image to come in between and to be full.</p>
  
  <p><img src="https://i.stack.imgur.com/TelSv.jpg" alt="enter image description here"></p>
  
  <p>My code :</p>
  
  <pre><code>    Dim bounds As Rectangle  
      Dim screenshot As System.Drawing.Bitmap  
      Dim graph As Graphics  
      bounds = Screen.PrimaryScreen.Bounds  
      screenshot = New System.Drawing.Bitmap(bounds.Width, bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppRgb)  
      graph = Graphics.FromImage(screenshot)  
      graph.CopyFromScreen(618, 191, 850, 455, bounds.Size, CopyPixelOperation.SourceCopy)  
      screenshot.Save("d:\\dcap.bmp", Imaging.ImageFormat.Bmp)  `
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/TelSv.jpg" alt="enter image description here"></p>