Render image to a page
<p>I have a page <code>http://www.mysite.com/image.aspx</code>, that I want to load and display an image instead of rendering HTML.</p>

<p>I have the ContentType of the page set to <code>image/png</code>, and here's my code:</p>

<pre><code>using (Bitmap image = new Bitmap("http://www.google.com/images/img.png"))
{
    using (MemoryStream ms = new MemoryStream())
    {
        image.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
        ms.WriteTo(Response.OutputStream);
    }
}
</code></pre>

<p>But I get an error saying:</p>

<blockquote>
  <p><em><strong>URI formats are not supported.</em></strong> </p>
</blockquote>

<p>How can I load an external image and render it to the page?</p>
