-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Advanced usage QR Code renderers
- Introduction to the "QR Code Renderers"
- Overview of the different Renderers
- QRCode-Renderer in detail
- Base64QRCode-Renderer in detail
- BitmapByteQRCode-Renderer in detail
- SvgQRCode-Renderer in detail
- UnityQRCode-Renderer in detail
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.
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) |
Classname/Classfile: QRCode/QRCode.cs
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.
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);
(coming soon)
(coming soon)
Classname/Classfile: Base64QRCode / Base64QRCode.cs
(coming soon)
coming soon
(coming soon)
(coming soon)
Classname/Classfile: BitmapByteQRCode / BitmapByteQRCode.cs
(coming soon)
coming soon
(coming soon)
(coming soon)
Classname/Classfile: SvgQRCode / SvgQRCode.cs
(coming soon)
coming soon
(coming soon)
(coming soon)
Classname/Classfile: UnityQRCode / UnityQRCode.cs
(coming soon)
coming soon
(coming soon)
(coming soon)
Crafted with ❤ by Raffael Herrmann and a bunch of cool guys.