title: How to access and output images present in the resources in C# to html code?
body: <p>I want to generate and output an html file with images using C# winforms. I have a few images in the Resources folder, but I'm not able to output them to html.</p>
  
  <p>Could anyone suggest how to access and output images present in Resources to an html file?</p>
  
  <p>My code:</p>
  
  <pre><code>using System;
  using System.Windows.Forms;
  using System.IO;
  namespace winformToHtml
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
              InitializeComponent();
          }
  
          private void btn_report_Click(object sender, EventArgs e)
          {
              StreamWriter sWrite = new StreamWriter("C:\\report.html");
              sWrite.WriteLine("&lt;html&gt;");
              sWrite.WriteLine("&lt;body&gt;");
              sWrite.WriteLine("&lt;p&gt; &lt;img src= 'Resources/image.png' height='10%' width='5%' &gt; &lt;/p&gt;");                  
              sWrite.WriteLine("&lt;body&gt;");
              sWrite.WriteLine("&lt;html&gt;");
              sWrite.Close();
          }
      }
  }
  </code></pre>