title: Display Image from Embedded Resource in HTML in .NET App
body: <p>I create a HTML report inside a .net application, into which I want to display an image, which is going to come from a DLL where it is stored as an embedded resource.</p>
  
  <p>There are situations where I might have limited access to the file system. Even still, what is the best way to get the image out of the embedded resource (I can do this programmatically into a bitmap object) and display it in the html report for the user, preferably without using the file system. The HTML is created by the app.</p>
  
  <p>Some more info:</p>
  
  <p>The report is created by traversing a tree of objects in code, each of which return a piece of html:</p>
  
  <pre><code>Function GetReportLine() as String
      Return String.Format("&lt;p&gt;Account Created on {0}&lt;/p&gt;", CreatedTime.ToString("dd/MMM/yyyy h:mm tt"))
  End Function
  </code></pre>
  
  <p>These are then compiled into a string, decorated with some CSS, and passed into a WebBrowser control embedded on a Form to display to the user.</p>
  
  <p>I want to display an image from my embedded resource like this:</p>
  
  <pre><code>Return String.Format("&lt;p&gt;&lt;img src=MyEmbeddedResourceImage&gt;Account Created on {0}&lt;/p&gt;", CreatedTime.ToString("dd/MMM/yyyy h:mm tt"))
  </code></pre>