Set width and height of QR code

How to set width and height of QR Code image to 100px X 100px


Thank you for inquiry.

Please refer to for generating barcodes of exact size.

However, the size of image depends upon the size of codetext and some other factors. For more information please visit and

Can you give me sample code for controlling width and height of QR code (2D barcode) with margin zero from all side.


Please see the code below:

private static Bitmap GetBarcodeImage(string code, float height, float width)
BarCodeBuilder builder = new BarCodeBuilder(code, Symbology.QR);
builder.GraphicsUnit = GraphicsUnit.Pixel;
builder.Margins.Bottom = 0;
builder.Margins.Right = 0;
builder.Margins.Top = 0;
builder.Margins.Left = 0;
builder.BorderVisible = false;
builder.BorderWidth = 0;
builder.CodeLocation = CodeLocation.None;
builder.AutoSize = false;
builder.ImageHeight = height;
builder.BarHeight = height-1;
builder.xDimension = 0.6f;

return builder.BarCodeImage;