C# Class for Generating QR Codes using the Google Charts API

Posted on Wednesday, July 8, 2015 at 3:41 PM into csharp, code, tutorial & video by Steve Woods.
Roughly a 1 minute read.

QR codes are those nifty little barcode-type things you sometimes find on packaging which, when scanned with a smartphone, can perform an action such as taking you to a URL to view more detailed information.

Google provide a nice little API to make producing QR codes super simple. I've made it even simpler for C# programmers by wrapping the API in a C# Class which will allow you to specify any or all of their required and optional parameters, or simply the data you'd like to encode with default values for everything else.

No third party controls are required, although you'll obviously need Internet access so that the API can be called - I say API, it's simply a HTTP/GET request but you get the idea.

Live Coding Example

Basic Usage

string qrcode = new QRCodeHelper.GenerateUrl(DATA);

Output

A string URL which can be used as an img src tag in a HTML Page, or an object property in a WinForms application (such as PictureBox.ImageLocation).

Source Code

;

Comments

Please consider what you post!
Chillax if you're angry.