how can I display dynamically generated bmp in browser
<p>On a .aspx page I am creating a bmp using the System.Drawing namespace. When the bmp is finished I am sending it to the browser using:</p>

<pre><code>using (MemoryStream ms = new MemoryStream())
            {
                bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
                byte[] buffer = ms.GetBuffer();
                HttpContext.Current.Response.OutputStream.Write(buffer, 0, buffer.Length);
                HttpContext.Current.Response.Flush();
            }
</code></pre>

<p>This seems to simply send the bmp to the browser which renders it - but not as an html page. You can't view source - it seems to be simply a bitmap.</p>

<p>I'd like the bmp to be sent to the browser but as the 'content' of the body tag of an html page.</p>

<p>Is the only way to do this to save (write) the bmp to disk and then use that file as the src of an image tag? Or is there a way of rendering it directly to the browswer but still as part of a html page?</p>
