Skip to content

Advanced usage QR Code renderers

Raffael Herrmann edited this page May 8, 2017 · 38 revisions
  1. Introduction to the "QR Code Renderers"
  2. Overview of the different Renderers
  3. QRCode-Renderer in detail
  4. Base64QRCode-Renderer in detail
  5. BitmapByteQRCode-Renderer in detail
  6. SvgQRCode-Renderer in detail
  7. UnityQRCode-Renderer in detail

Introduction to the "QR Code Renderers"

As explained in the architectural overview, the QRCoder separates data/information from output/representation. So in data/core layer you create the QR Code information:

CodeGenerator qrGenerator = new QRCodeGenerator();
QRCodeData qrCodeData = qrGenerator.CreateQrCode("The payload aka the text which should be encoded.", QRCodeGenerator.ECCLevel.Q);

Now you have to bringn this information into a representation you like - or better said - you have to convert this information into the output format you like. Therefore you can use the so called "QR Code renderers". This are classes of the QRCoder which help you to represent that QrCodeData the way you prefer.

Before we have a look at each of the renderers, let's have a quick look onto the following comparison table which shows the benefits of each of the renderer classes.

Overview of the different Renderers

Name Where to use? Output Format
QRCode In full .NET Framework environments Bitmap-object (System.Drawing.Bitmap)
Base64QRCode In full .NET Framework environments String (QR Code encoded as Base64)
BitmapByteQRCode In .NET Standard / .NET Core environments Byte-Array containing RAW-Bitmap
SvgQRCode In full .NET Framework environments String (QR Coded as SVG vector graphic)
UnityQRCode In full .NET Framework environments Texture2D (UnityEngine.Texture2D)

QRCode-Renderer in detail

Classname/Classfile: QRCode/QRCode.cs

When to use?

Use it if you want a pixel-based image (=Bitmap) and if you are working with .NET Framework. Use it if you want to show the QR Code in your app, save the QR Code as image file or deliver the QR Code as download.

How to use it - simple way

QRCodeGenerator qrGenerator = new QRCodeGenerator();
QRCodeData qrCodeData = qrGenerator.CreateQrCode("The text which should be encoded.", QRCodeGenerator.ECCLevel.Q);
QRCode qrCode = new QRCode(qrCodeData);
Bitmap qrCodeImage = qrCode.GetGraphic(20);

Parameter table

(coming soon)

Good to know

(coming soon)

Base64QRCode-Renderer in detail

Classname/Classfile: Base64QRCode / Base64QRCode.cs

When to use?

(coming soon)

How to use it - simple way

coming soon

Parameter table

(coming soon)

Good to know

(coming soon)

BitmapByteQRCode-Renderer in detail

Classname/Classfile: BitmapByteQRCode / BitmapByteQRCode.cs

When to use?

(coming soon)

How to use it - simple way

coming soon

Parameter table

(coming soon)

Good to know

(coming soon)

SvgQRCode-Renderer in detail

Classname/Classfile: SvgQRCode / SvgQRCode.cs

When to use?

(coming soon)

How to use it - simple way

coming soon

Parameter table

(coming soon)

Good to know

(coming soon)

UnityQRCode-Renderer in detail

Classname/Classfile: UnityQRCode / UnityQRCode.cs

When to use?

(coming soon)

How to use it - simple way

coming soon

Parameter table

(coming soon)

Good to know

(coming soon)

Clone this wiki locally