title: Add custom image or text to QR code generated by ZXing.Net
body: <p>I use <a href="https://zxingnet.codeplex.com" rel="noreferrer">ZXing.Net</a> library to generate a QR code image -</p>
  
  <p><img src="https://i.stack.imgur.com/jR653.png" alt="app screenshot"></p>
  
  <p>At the top of my class:</p>
  
  <pre><code>    [System.Runtime.InteropServices.DllImport("gdi32.dll")]
      public static extern bool DeleteObject(IntPtr hObject);
  </code></pre>
  
  <p>My method:</p>
  
  <pre><code>    protected void UpdateQRSource(String address)
      {
          QRCodeWriter qrcode = new QRCodeWriter();
          BarcodeWriter barcodeWriter = new BarcodeWriter
          {
              Format = BarcodeFormat.QR_CODE,
              Options = new EncodingOptions
              {
                  Width = 300,
                  Height = 300,
                  Margin = 4
              }
          };
  
          using (Bitmap bitmap = barcodeWriter.Write(address))
          {
              IntPtr hbmp = bitmap.GetHbitmap();
              try
              {
                  BitmapSource source = Imaging.CreateBitmapSourceFromHBitmap(
                      hbmp, 
                      IntPtr.Zero, 
                      Int32Rect.Empty,
                      BitmapSizeOptions.FromEmptyOptions());
                  qrImage.Source = source; // set WPF image source
              }
              finally
              {
                  DeleteObject(hbmp);
              }
          }
      }
  </code></pre>
  
  <p>Please advise me how to add short text string or a custom image in the middle of the QR code - similar to the <a href="https://en.wikipedia.org/wiki/QR_code#/media/File:Extreme_QR_code_to_Wikipedia_mobile_page.png" rel="noreferrer">Wikipedia visual QR code</a> below:</p>
  
  <p><img src="https://i.stack.imgur.com/r7twq.png" alt="Wikipedia"></p>
  
  <p><strong>UPDATE:</strong> </p>
  
  <p>Embedding custom logo in QR code (without breaking the latter!) seems to be not a trivial task as the scientific publication <a href="http://www.researchgate.net/publication/262527881_QR_Images_Optimized_Image_Embedding_in_QR_Codes" rel="noreferrer">QR Images: Optimized Image Embedding in QR Codes</a> shows... </p>
  
  <p>But I still wonder if I could generate a QR code (as in the above source code), then overlay it with a custom text or logo, then validate the resulting image again by ZXing.Net.</p>