Table of Contents

Class Barcode

Namespace
TwBlazor.Services.Encoding
Assembly
TwBlazor.dll

An encoded one-dimensional barcode: a row of dark and light modules (the narrowest bar width), ready to be drawn by any renderer.

public sealed class Barcode : IEncodedSymbol
Inheritance
Barcode
Implements
Inherited Members
Extension Methods

Remarks

The barcode is immutable, so it can be cached and shared freely. It does not include the quiet zone; a renderer adds that margin itself, using QuietZone as the recommended width. Draw it with the SymbolSvg methods.

Properties

Format

Gets the symbology the barcode was encoded with.

public BarcodeFormat Format { get; }

Property Value

BarcodeFormat

Height

Gets the number of rows: always 1, as the bars are stretched to any height.

public int Height { get; }

Property Value

int

this[int]

Gets whether the module at a position is dark (part of a bar).

public bool this[int x] { get; }

Parameters

x int

The module, from 0 at the left.

Property Value

bool

true for a dark module; false for a light one or a position outside the bars.

this[int, int]

Gets whether the module at a position is dark.

public bool this[int x, int y] { get; }

Parameters

x int

The column, from 0 at the left.

y int

The row, from 0 at the top.

Property Value

bool

true for a dark module; false for a light one or a position outside the grid.

QuietZone

Gets the light margin, in modules, the symbology needs on each side so scanners can find the bars.

public int QuietZone { get; }

Property Value

int

Text

Gets the human readable text printed under the bars, including any check digit that was added.

public string Text { get; }

Property Value

string

Width

Gets the width of the bars, in modules, without the quiet zone.

public int Width { get; }

Property Value

int