Skip to content

QrCodeNode ​

Namespace: Hex1b

Assembly: Hex1b.dll

Render node for displaying QR codes in the terminal. Created by reconciling a .

csharp
public sealed class QrCodeNode : Hex1bNode

Inheritance ​

Object → Hex1bNode → QrCodeNode

Properties ​

Data ​

Gets or sets the data to encode in the QR code.

Returns: String

csharp
public string Data { get; set; }

QuietZone ​

Gets or sets the number of module widths to use as a border (quiet zone).

Returns: Int32

csharp
public int QuietZone { get; set; }

Methods ​

MeasureCore(Constraints) ​

Measures the size required to display the QR code within the given constraints.

Parameters:

  • constraints (Constraints): The size constraints for layout.

Returns: Size

The measured size. Width and height include the QR code matrix plus quiet zone borders.

csharp
protected override Size MeasureCore(Constraints constraints)

Render(Hex1bRenderContext) ​

Renders the QR code to the terminal using block characters.

Parameters:

  • context (Hex1bRenderContext): The render context providing terminal access and inherited styling.
csharp
public override void Render(Hex1bRenderContext context)

Remarks ​

QrCodeNode handles generating, measuring, arranging, and rendering QR codes using Unicode block characters (█). The QR code is generated using the QRCoder library and rendered to the terminal as a grid of blocks.

This node is not focusable and does not handle input.

Released under the MIT License.