QRCode
A simple class to create easily create aesthetic pleasing QRCodes.
It'll create a QRCodeProcessor and build a custom render function on top of it.
It includes things like:
QR Codes with a logo at the center
QR Codes with dots instead of squares
Colorful QR Codes (including linear gradient colors)
If you have a suggestion for a nice QR Code style, feel free to open a PR, or an Issue with your suggestion :)
Author
Rafael Lins - g0dkar
See also
Constructors
Properties
Size of the canvas where the QRCode will be drawn into (the final image will be a square of canvasSize
by canvasSize
)
Function that will handle color processing (which color is "light" and which is "dark") - Defaults to DefaultColorFunction.
Error Correction Level to add to embed in the QRCode. The higher the ErrorCorrectionLevel is, the higher will be the QRCode tolerance to damage - Defaults to ErrorCorrectionLevel.LOW.
The QRCodeGraphics (aka "canvas") where all the drawing will happen
Factory of QRCodeGraphics instances - Defaults to QRCodeGraphicsFactory.
Information Density (formerly known as typeNum
). A number that represents how much data this QRCode can hold - Defaults to a value computed by QRCodeProcessor.infoDensityForDataAndECL.
Which mask pattern to apply to the QRCode. Slightly change the squares. Mostly for aesthetics.
The underlying QRCodeProcessor object that will do all calculations
Raw QRCode data computed by QRCodeProcessor
Function that will handle drawing the shapes of each square - Defaults to DefaultShapeFunction with innerSpace = 0
.
Functions
Computes a squareSize to make sure the QRCode can fit into an area of width by height pixels
Executes all the drawing of the QRCode and returns the QRCodeGraphics of the complete QRCode.
Completely resets the QRCode drawing. After this, you can call renderToBytes or render to redraw the whole QRCode. Useful when you want, for example, a transparent background QRCode to add to a larger image and then the same QRCode drawn on top of a custom background.
Computes a squareSize to make sure the QRCode can fit into an area of width by height pixels