QRCodeConsoleRenderer Class

Provides methods to render a QR code using Unicode block characters.

public static class QRCodeConsoleRenderer

Methods

NameDescription
ToConsoleString(QRCode, ConsoleRenderOptions?)Renders the QR code as a string using Unicode block characters, two rows of modules per line.
WriteTo(QRCode, TextWriter, ConsoleRenderOptions?)Renders the QR code to a TextWriter using Unicode block characters.
WriteToConsole(QRCode, ConsoleRenderOptions?)Renders the QR code to Console.Out.

ToConsoleString(QRCode, ConsoleRenderOptions?)

QRCodeConsoleRenderer.cs

Renders the QR code as a string using Unicode block characters, two rows of modules per line.

public static string ToConsoleString(this QRCode qrCode, ConsoleRenderOptions? options = null)

Parameters

qrCode QRCode
The QR code to render.
options ConsoleRenderOptions?
The rendering options, or null for the defaults.

Returns

string The lines of the QR code, without trailing spaces and without a final new line.

Exceptions

ArgumentNullException
qrCode is null.
ArgumentOutOfRangeException
An option is out of range, or the text is too large for a string.

WriteTo(QRCode, TextWriter, ConsoleRenderOptions?)

QRCodeConsoleRenderer.cs

Renders the QR code to a TextWriter using Unicode block characters.

public static void WriteTo(this QRCode qrCode, TextWriter writer, ConsoleRenderOptions? options = null)

Parameters

qrCode QRCode
The QR code to render.
writer TextWriter
The destination.
options ConsoleRenderOptions?
The rendering options, or null for the defaults.

Exceptions

ArgumentNullException
qrCode or writer is null.
ArgumentOutOfRangeException
An option is out of range, or the text is too large for a string.

WriteToConsole(QRCode, ConsoleRenderOptions?)

QRCodeConsoleRenderer.cs

Renders the QR code to Console.Out.

public static void WriteToConsole(this QRCode qrCode, ConsoleRenderOptions? options = null)

Parameters

qrCode QRCode
The QR code to render.
options ConsoleRenderOptions?
The rendering options, or null for the defaults.

Exceptions

ArgumentNullException
qrCode is null.
ArgumentOutOfRangeException
An option is out of range, or the text is too large for a string.