title: Writing a dynamically created bitmap to a panel (or any other control)
body: <p>Right now I have the following code, which works fine to display my dynamically created image in the web page, but it overwrites whatever controls there were. How do I display the image inside a specific control, instead?</p>
  
  <p>Ideally, I would like it to be displayed inside a panel (Panel1) that I have defined on my page.</p>
  
  <pre><code>        Response.Clear();
          Response.ContentType = "image/png";
          Bitmap bmp = new Bitmap(W, H,  PixelFormat.Format24bppRgb);
          Graphics g = Graphics.FromImage(bmp);
  
          //lots of drawing code
  
          using (MemoryStream ms = new MemoryStream())
          {
              bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
              ms.WriteTo(Response.OutputStream);
          }
  
          bmp.Dispose();
          Response.End();
  </code></pre>
  
  <p>As I said, this works beautifully, except that it overwrites whatever controls I have on my page with the image, while I would like to constrain it to remain inside a panel. </p>
  
  <p>is there a way to achieve this?</p>