title: Show an image from a URL in WinForms PictureBox
body: <p>Hi I have a WinForms project targetting .net core. I am trying to load an image from a URL, but all I am getting is this:</p>
  <p><a href="https://i.stack.imgur.com/AFWus.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AFWus.png" alt="screenshot" /></a></p>
  <p>Inside a UserControl I have added a PictureBox (pic1) and a Button.</p>
  <p>Added the following as an example to the click event of the button:</p>
  <pre><code>pic1.LoadAsync(&quot;https://images.pexels.com/photos/4815143/pexels-photo-4815143.jpeg&quot;);
  </code></pre>
  <p>also</p>
  <pre><code>pic1.ImageLocation = &quot;https://images.pexels.com/photos/4815143/pexels-photo-4815143.jpeg&quot;;
  </code></pre>
  <p>Have tried with different URLs</p>
  <p>Any ideas what is wrong?</p>
  <p><strong>Edit</strong>
  I've tried an alternative option, something seems to be getting stuck on DownloadData</p>
  <pre><code> using (WebClient webClient = new WebClient())
   {
   byte[] data = webClient.DownloadData(&quot;https://images.pexels.com/photos/4815143/pexels-photo-4815143.jpg&quot;);
  
  
      using (MemoryStream mem = new MemoryStream(data))
      {
          using (var yourImage = Image.FromStream(mem))
          {
          
          }
      }
   }
  </code></pre>