Skip to content

Compare: Advanced usage QR Code renderers

Showing with 32 additions and 14 deletions.
  1. +6 −5 Advanced-usage---Payload-generators.md
  2. +18 −7 Advanced-usage---QR-Code-renderers.md
  3. +8 −2 Release-Notes.md
25 changes: 18 additions & 7 deletions Advanced-usage---QR-Code-renderers.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,12 @@ This renderer is the way to go, if you want to draw an icon onto the QR Code.In


## 2.2 AsciiQRCode-Renderer in detail
**Classname/Classfile:** AsciiQRCode / AsciiQRCode.cs
**Classname/Classfile:** ASCIIQRCode / ASCIIQRCode.cs

#### When to use?
Useful for web- and retro-environments. By use of this encoder you get a QR code encoded as string just build out of ASCII chars.
Useful for web-, retro- and console-environments. By use of this encoder you get a QR code encoded as string just build out of chars. By default UTF-8 block symbols are used.

**Trivia:** *The renderer is called Ascii renderer, although it uses characters from the Utf-8 character set by default. The idea behind this is that the renderer uses a text-based graphical representation that is reminiscent of classic Ascii art. Naming it Utf8QrCode was rejected in the design phase, as it would be difficult to deduce from this name what type of return value the renderer has.*

#### How to use it - simple way
```csharp
Expand All @@ -117,17 +119,17 @@ string qrCodeAsAsciiArt = qrCode.GetGraphic(1);
```

#### Parameter table
There are two different overloads:
There are three different overloads:

**Overload 1** *(Return type: string)*

|Parameter name|Type|Default|Description|
|---|---|---|---|
|repeatPerModule|int||Number of repeated darkColorString/whiteSpaceString per module.|
|repeatPerModule|int||Number of repeated darkColorString/whiteSpaceString per module. (Must be 1 or greater.)|
|darkColorString|string|`██`|String for use as dark color modules. In case of string make sure whiteSpaceString has the same length.|
|whiteSpaceString|string|<code>` `</code>|String for use as white modules (whitespace). In case of string make sure darkColorString has the same length.|
|drawQuietZones|bool|true|If true a white border is "drawn" around the whole QR Code|
|endOfLine|string|"\n"|End of line separator. (Default: \n)|
|drawQuietZones|bool|`true`|If true a white border is "drawn" around the whole QR Code|
|endOfLine|string|`\n`|End of line separator.|

**Overload 2** *(Functionname: GetLineByLineGraphic, Return type: string[])*

Expand All @@ -136,10 +138,19 @@ There are two different overloads:
|repeatPerModule|int||Number of repeated darkColorString/whiteSpaceString per module.|
|darkColorString|string|`██`|String for use as dark color modules. In case of string make sure whiteSpaceString has the same length.|
|whiteSpaceString|string|<code>` `</code>|String for use as white modules (whitespace). In case of string make sure darkColorString has the same length.|
|drawQuietZones|bool|true|If true a white border is "drawn" around the whole QR Code|
|drawQuietZones|bool|`true`|If true a white border is "drawn" around the whole QR Code.|

**Overload 3** *(Functionname: GetGraphicSmall, Return type: string)*

|Parameter name|Type|Default|Description|
|---|---|---|---|
|drawQuietZones|bool|true|If true a border is "drawn" around the whole QR Code.|
|invert|bool|`false`|If set to true, light- and dark color will be switched.|
|endOfLine|string|`\n`|End of line separator.|

#### Good to know
If you set *darkColorString* or *whiteSpaceString* you have to ensure that they are both of the same length. Also you should keep in mind that this type of rendering only works when shown in a so called "Monospace" font.
If you need a smaller representation than GetGraphic with `repeatPerModule: 1`, use `GetGraphicSmall` which compresses two module lines into one character line each.


## 2.3 Base64QRCode-Renderer in detail
Expand Down