title: Need to take screenshot of YouTube video programmatically
body: <p>I need to programmatically take an image of an embedded video from various sources (not just YouTube).
  So if you go to <a href="https://www.youtube.com/embed/_Lc3GJ2O5ic" rel="nofollow noreferrer">this</a> embedded video.</p>
  
  <p>I need to take a picture of the embedded video before it starts, which in the aforementioned link is the two GT-R cars lined up.</p>
  
  <pre><code>string source = "https://www.youtube.com/embed/_Lc3GJ2O5ic"; 
  
  System.Windows.Forms.WebBrowser wb = new System.Windows.Forms.WebBrowser(); 
  
  wb.AllowNavigation = true; wb.Navigate(source);
  
  wb.Navigate(source);
  
  b.DocumentCompleted += new System.Windows.Forms.WebBrowserDocumentCompletedEventHandler(wb_DocumentCompleted);
  
  private void wb_DocumentCompleted(object sender, System.Windows.Forms.WebBrowserDocumentCompletedEventArgs e)
          {
              System.Windows.Forms.WebBrowser wb = sender as System.Windows.Forms.WebBrowser;
              Bitmap bitmap = new Bitmap(640, 480);
              wb.DrawToBitmap(bitmap, new Rectangle(0, 0, wb.Width, wb.Height));
              wb.Dispose();
  
              string filepath = "C:\\Users\\myUserName\\Desktop\New folder\\gtr.bmp";
              bitmap.Save(filepath);
  
          }
  </code></pre>
  
  <p>but when I go to the picture all I'm getting is a blackbox:</p>
  
  <p><a href="https://i.stack.imgur.com/MprM7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MprM7.png" alt="enter image description here"></a></p>