title: How to add a 'System.Drawing.Image' to a 'System.Web.UI.WebControls.Image'
body: <p>I have two functions:</p>
  
  <p>Function 1: ImageToByteArray: Is used to Convert an Image into a Byte Array and then Store in an Oracle Database, in a BLOB Field.</p>
  
  <pre><code>            public byte[] ImageToByteArray(string sPath)
              {
                  byte[] data = null;
                  FileInfo fInfo = new FileInfo(sPath);
                  long numBytes = fInfo.Length;
                  FileStream fStream = new FileStream(sPath, FileMode.Open, FileAccess.Read);
                  BinaryReader br = new BinaryReader(fStream);
                  data = br.ReadBytes((int)numBytes);
                  return data;
              }
  </code></pre>
  
  <p>Function 2: ByteArrayToImage: Is used to Convert a Byte Array from the Database into an Image:</p>
  
  <pre><code>           public System.Drawing.Image ByteArrayToImage(byte[] byteArray)
              {
                  MemoryStream img = new MemoryStream(byteArray);
                  System.Drawing.Image returnImage = System.Drawing.Image.FromStream(img);
                  return returnImage;
              }
  </code></pre>
  
  <p>In my Markup I have an Imgage Control:
  <code>&lt;asp:Image ID="Image1" runat="server" /&gt;</code></p>
  
  <p>In the Code Behind I want to Assign the Returned Value from Function 2 to (which is of type <strong>System.Drawing.Image</strong>) to the "image1" control which is of type (<strong>System.Web.UI.WebControls.Image</strong>).</p>
  
  <p>Obviously I can't just assign:
  <code>image1 = ByteArrayToImage(byteArray);</code>
  because I'd get the following error: Cannot implicitly convert type 'System.Drawing.Image' to 'System.Web.UI.WebControls.Image'</p>
  
  <p>Is there anyway to do this?</p>