//qrcode-kotlin/qrcode.raw/QRCodeProcessor/renderShaded
[common]\
fun renderShaded(cellSize: Int = DEFAULT_CELL_SIZE, margin: Int = DEFAULT_MARGIN, rawData: QRCodeRawData = encode(), qrCodeGraphics: QRCodeGraphics = graphicsFactory.newGraphicsSquare( computeImageSize( cellSize, margin, rawData, ), ), renderer: (Int, Int, QRCodeSquare, QRCodeGraphics) -> Unit): QRCodeGraphics
Renders a QR Code image based on its computed data.
This function provides a way to implement more artistic QRCodes. The renderer is a function that draws a single square of the QRCode. It receives 4 parameters: the (x, y)
coordinates where the square is, the cellData and the QRCodeGraphics for it to freely draw.
Tip: for better looking QR Codes, try using QRCode instead ;)
A QRCodeGraphics with the QR Code rendered on it. It can then be saved or manipulated as desired.
common
cellSize | The size in pixels of each square (cell) in the QR Code. Defaults to 25 . |
margin | Amount of space in pixels to add as a margin around the rendered QR Code. Defaults to 0 . |
rawData | The data matrix of the QR Code. Defaults to this.encode(). |
qrCodeGraphics | The QRCodeGraphics where the QRCode will be painted into. |
renderer | Lambda that draws a single QRCode square. It receives as parameters the (x, y) of the cell, the QRCodeSquare (aka "cell") being drawn and a QRCodeGraphics for it to draw the square. |
QRCode |
QRCode.Companion.ofSquares |
QRCode.Companion.ofCircles |
QRCode.Companion.ofRoundedSquares |
QRCodeSquare |
QRCodeGraphics |
Colors |