title: convert bitmap to image c#
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1606784/convert-bitmap-to-image-c">convert bitmap to image c#</a>  </p>
  </blockquote>
  
  
  
  <p>I want to convert a bitmap to an image object and display it .
  This is my code:</p>
  
  <pre><code>//using System.Drawing;
  
  Image objImage = Image.FromFile(Server.MapPath("large.jpg"));//From File
  int height = objImage.Height;//Actual image width
  int width = objImage.Width;//Actual image height
  
  Bitmap bitmapimage = new Bitmap(objImage, width, height);// create bitmap with same size of Actual image
  Graphics g = Graphics.FromImage(bitmapimage);              
  
  Image bitmap2 = (Image)Bitmap.FromFile(Server.MapPath("logo.png"));
  g.DrawImage(bitmap2, (objImage.Width-bitmap2.Width) / 2,( objImage.Height-bitmap2.Height )/ 2);
  Response.ContentType = "image/jpeg";
  bitmapimage.Save(Response.OutputStream, ImageFormat.Jpeg);
  </code></pre>
  
  <p>How can I convert the bitmap image into an image object?
  Thank you,
  Alina</p>