0

I have create a QRcode with iTextSharp but how can i add image in QRcode?

for example in my code:

var paramQR = new Dictionary<EncodeHintType, object>();
paramQR.Add(EncodeHintType.CHARACTER_SET, "UTF-8");
paramQR.Add(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.L);
BarcodeQRCode qrcode = new BarcodeQRCode("some text", 50, 50, paramQR);

I want replace "some text" with an image. can i do that?

Nima
  • 33
  • 3
  • I think you will need a QR libary that supports image integration. Google should help you. Or do you mean you want the QR as an image? (Do go for jpg as it will be too soft.) Any QR lib should be able to do that.. – TaW Aug 07 '21 at 07:07
  • 1
    you can also encode a picture into base64 string and insert the string to the QR code e.x. "data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUA AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO 9TXL0Y4OHwAAAABJRU5ErkJggg==" – Or Yaacov Aug 07 '21 at 08:09
  • @TaW No I want to insert an image inside qrcode. and unfortunately, I did not find anything I searched for. – Nima Aug 07 '21 at 08:48
  • @OrYaacov can you give me a sample? thanks a lot – Nima Aug 07 '21 at 08:50
  • Did you see [this](https://stackoverflow.com/questions/31053936/add-custom-image-or-text-to-qr-code-generated-by-zxing-net) ? Or [this](https://www.youtube.com/watch?v=wgcHT6Uu_ew) – TaW Aug 07 '21 at 12:11
  • I want to let other people see the pictures by scanning the QR code – Nima Aug 09 '21 at 03:29
  • 1
    Huh? So what you really want is to have a link to the images in the QR code? Where shall they be stored? You can't encode images of any interesting site in the small amout of data the QR can hold! – TaW Aug 10 '21 at 10:39

0 Answers0