Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ZXing.Net QR Code Size

I use this code for generating my qr code ZXing.Net (http://zxingnet.codeplex.com/)

IBarcodeWriter writer = new BarcodeWriter { Format = BarcodeFormat.QR_CODE };
qrcode.Source = writer.Write(stringsecure.Text);

but the image is very very small..

How to set the dimension if possible?

like image 587
Federal09 Avatar asked Jun 09 '26 14:06

Federal09


2 Answers

You can set the width and height of the resulting image with the Options property:

IBarcodeWriter writer = new BarcodeWriter
{
   Format = BarcodeFormat.QR_CODE,
   Options = new QrCodeEncodingOptions
      {
         Width = 400,
         Height = 400
      }
};
qrcode.Source = writer.Write(stringsecure.Text);
like image 192
Michael Avatar answered Jun 11 '26 04:06

Michael


Like John Dubya, I find that the sizing seems to "jump", it doesn't scale to any integer. I am using ZXing QRCodeWriter and BarcodeWriter, they both exhibit the same behavior.

like image 37
Beans Avatar answered Jun 11 '26 02:06

Beans