title: Create QR Code Base64 and put in IMG tag of HTML
body: <p>I get some JSON data and create a QR Code from it. I then want to convert that to a Base64 string and put it in an img tag in my html. However, the QR Code doesn't image is not created. This is how I try it:</p>
  
  <pre><code>// my string created from the JSON
  string strInventoryData = string.Format(dataPortable, GeneratorID, MarketUnit);
  
  // generate the QR Code
  ZXing.Common.BitMatrix byteIMGNew = writer.encode(strInventoryData, 
                                             ZXing.BarcodeFormat.QR_CODE, 240, 240, null);
  Bitmap bmp1 = new Bitmap(byteIMGNew.Width, byteIMGNew.Height);
  Graphics g1 = Graphics.FromImage(bmp1);
   g1.Clear(Color.White);
   for (int x = 0; x &lt; byteIMGNew.Height; ++x)
   {
      for (int y = 0; y &lt; byteIMGNew.Width; ++y)
      {
          if (byteIMGNew[x, y])
             g1.FillRectangle(Brushes.Black, x, y, 1, 1);
          else
             g1.FillRectangle(Brushes.White, x, y, 1, 1);
      }
  }
  
  // create the base64 encoded image
  System.IO.MemoryStream ms = new System.IO.MemoryStream();
  bmp1.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
  byte[] byteImage = ms.ToArray();
  var SigBase64 = Convert.ToBase64String(byteImage);
  
  // put it in the htm
  strInnerData += "&lt;td align='center' style='width:240px;height:240px'&gt;
      &lt;img alt='Embedded Image' src='data:image/png;base64,'" + SigBase64.ToString() + "' /&gt;&lt;/td&gt;";
  </code></pre>
  
  <p>What am I doing wrong?</p>