This project is read-only.

QR Code Size

Jan 23, 2013 at 12:07 AM


First I have to say that your product is great!  Pretty straightforward to use.  I think you've really got something going here.

Secondly, I'm attempting to specify the size of the QR Code when it is generated, however I don't see an easy way to do so.  Please see my code below and let me know if the answer is obvious.

Oh, and this is for a 4.0 web application.


Dim Successful As Boolean = False
Dim Encoder As New QrEncoder(ErrorCorrectionLevel.M)
Dim QRCode As New Gma.QrCodeNet.Encoding.QrCode

Successful = Encoder.TryEncode(StringToEncode, QRCode)

Dim imageRenderer As New Renderer(5, Brushes.Black, Brushes.White)

imageRenderer.CreateImageFile(QRCode.Matrix, outFileName, System.Drawing.Imaging.ImageFormat.Png)

Return Successful

Jan 23, 2013 at 5:37 AM

From your code, it looks like you are using 0.3 version of library. Which it doesn't have a nice way to specify the size of QrCode. 

I put a lot of work on next version, and will try to put it under release before end of Feb. 

One thing you can do is grab latest source code and compile it yourself. It doesn't have any dependency, all library used by this generator is from basic libraries. And what I want to add before next release is WinRT and Silverlight version. Normal version is pretty much solid. 

Documentation for latest source code can be found:

I only refer you to render class, as you are building web application. Also inside source code you can find examples for winform and WPF.


What I would suggest to use is EncapsulateScriptRenderer, SVGRenderer and DrawingBrushRenderer. 

DrawingBrushRenderer you have to add reference for some of WPF library, it should be safe under ASP.Net server. We just use those library to generate bitmap. 


EncapsulateScriptRenderer is for Adobe's EPS vector graph, while SVG you can use to display QrCode in MVC application or as SVG file. 

Use drawingBrushRenderer to create PNG or any other bitmap image files. Check out documentation for specify QrCode Size. 


Let me know if you have any further question. 

Jan 23, 2013 at 4:44 PM

Hey silverlancer,


It worked great!  I can't wait to see all that you do with this generator if you still have it in beta and it's turning out results like this!