diff --git a/dotnet/QrCodeGenerator/BitArrayExtensions.cs b/dotnet/QrCodeGenerator/BitArrayExtensions.cs
index 290ba3d..c0c4ca7 100644
--- a/dotnet/QrCodeGenerator/BitArrayExtensions.cs
+++ b/dotnet/QrCodeGenerator/BitArrayExtensions.cs
@@ -1,5 +1,5 @@
/*
- * QR Code generator library (.NET)
+ * QR code generator library (.NET)
*
* Copyright (c) Project Nayuki. (MIT License)
* https://www.nayuki.io/page/qr-code-generator-library
@@ -27,38 +27,39 @@ using System.Collections;
namespace IO.Nayuki.QrCodeGen
{
///
- /// Provides extension methods for the class.
+ /// Extension methods for the class.
///
public static class BitArrayExtensions
{
///
- /// Appends the specified number of low-order bits of the specified value to this
- /// bit array. Requires 0 ≤ len ≤ 31 and 0 ≤ val < 2len.
+ /// Appends the specified number bits of the specified value to this bit array.
+ ///
+ /// The least significant bits of the specified value are added. They are appended in reverse order,
+ /// from the most significant to the least significant one, i.e. bits 0 to len-1
+ /// are appended in the order len-1, len-2 ... 1, 0.
+ ///
+ ///
+ /// Requires 0 ≤ len ≤ 31, and 0 ≤ val < 2len.
+ ///
///
- /// this bit array
- /// the value to append
- /// the number of low-order bits in the value to take
- /// Thrown if the value or number of bits is out of range
- /// Thrown if appending the data would make bit length exceed
+ /// The BitArray instance that this method extends.
+ /// The value to append.
+ /// The number of low-order bits in the value to append.
+ /// Value or number of bits is out of range.
public static void AppendBits(this BitArray bitArray, uint val, int len)
{
- if (len < 0 || len > 31 || (val >> len) != 0)
+ if (len < 0 || len > 31 || val >> len != 0)
{
throw new ArgumentOutOfRangeException(nameof(len), "'len' out of range");
}
- if (len < 0 || len > 31 || (val >> len) != 0)
+ if (len < 0 || len > 31 || val >> len != 0)
{
throw new ArgumentOutOfRangeException(nameof(val), "'val' out of range");
}
int bitLength = bitArray.Length;
- if (int.MaxValue - bitLength < len)
- {
- throw new InvalidOperationException("Maximum length reached");
- }
-
bitArray.Length = bitLength + len;
uint mask = 1U << (len - 1);
for (int i = bitLength; i < bitLength + len; i++) // Append bit by bit
@@ -74,21 +75,15 @@ namespace IO.Nayuki.QrCodeGen
///
- /// Appends the content of the specified bit array to this array.
+ /// Appends the content of the specified bit array to the end of this array.
///
- /// this bit array
- /// the bit array whose data to append (not null)
- /// Thrown if the bit array is null
- /// Thrown if appending the data would make the bit length exceed
+ /// The BitArray instance that this method extends.
+ /// The bit array to append
+ /// If bitArray is null.
public static void AppendData(this BitArray bitArray, BitArray otherArray)
{
Objects.RequireNonNull(otherArray);
int bitLength = bitArray.Length;
- if (int.MaxValue - bitLength < otherArray.Length)
- {
- throw new InvalidOperationException("Maximum length reached");
- }
-
bitArray.Length = bitLength + otherArray.Length;
for (int i = 0; i < otherArray.Length; i++, bitLength++) // Append bit by bit
{
diff --git a/dotnet/QrCodeGenerator/DataTooLongException.cs b/dotnet/QrCodeGenerator/DataTooLongException.cs
index 25c8841..822c296 100644
--- a/dotnet/QrCodeGenerator/DataTooLongException.cs
+++ b/dotnet/QrCodeGenerator/DataTooLongException.cs
@@ -1,5 +1,5 @@
/*
- * QR Code generator library (.NET)
+ * QR code generator library (.NET)
*
* Copyright (c) Project Nayuki. (MIT License)
* https://www.nayuki.io/page/qr-code-generator-library
@@ -26,31 +26,34 @@ using System.Collections.Generic;
namespace IO.Nayuki.QrCodeGen
{
///
- /// Thrown when the supplied data does not fit any QR Code version.
+ /// The exception that is thrown when the supplied data does not fit in the QR code.
///
///
/// Ways to handle this exception include:
///
- ///
Decrease the error correction level if it was greater than
- ///
If the advanced
- /// function or the function was called,
- /// then increase the maxVersion argument if it was less than .
- /// (This advice does not apply to the other factory functions because they search all versions up to
- ///
- ///
Split the text data into better or optimal segments in order to reduce the number of bits required.
- /// (See .)
- ///
Change the text or binary data to be shorter.
+ ///
Decrease the error correction level (if it was greater than )
+ ///
Increase the maxVersion argument (if it was less than ).
+ /// This advice applies to the advanced factory functions
+ /// and
+ /// only.
+ /// Other factory functions automatically try all versions up to .
+ ///
Split the text into several segments and encode them using different encoding modes
+ /// (see .)
+ ///
Make the text or binary data shorter.
///
Change the text to fit the character set of a particular segment mode (e.g. alphanumeric).
- ///
Propagate the error upward to the caller/user.
+ ///
Reject the data and notify the caller/user.
///
///
///
///
- ///
///
///
public class DataTooLongException : ArgumentException
{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The message that describes the error.
public DataTooLongException(string message)
: base(message)
{ }
diff --git a/dotnet/QrCodeGenerator/Objects.cs b/dotnet/QrCodeGenerator/Objects.cs
index cea4296..79e3114 100644
--- a/dotnet/QrCodeGenerator/Objects.cs
+++ b/dotnet/QrCodeGenerator/Objects.cs
@@ -1,5 +1,5 @@
/*
- * QR Code generator library (.NET)
+ * QR code generator library (.NET)
*
* Copyright (c) Project Nayuki. (MIT License)
* https://www.nayuki.io/page/qr-code-generator-library
@@ -25,8 +25,21 @@ using System;
namespace IO.Nayuki.QrCodeGen
{
+ ///
+ /// Helper functions to check for valid arguments.
+ ///
internal class Objects
{
+ ///
+ /// Ensures that the specified argument is not null.
+ ///
+ /// Throws a exception if the argument is null.
+ ///
+ ///
+ /// The type of the argument.
+ /// The argument to check.
+ /// Argument passed to function.
+ /// The specified argument is null.
internal static T RequireNonNull(T arg)
{
if (arg == null)
diff --git a/dotnet/QrCodeGenerator/QrCode.cs b/dotnet/QrCodeGenerator/QrCode.cs
index 41251f1..3b694ed 100644
--- a/dotnet/QrCodeGenerator/QrCode.cs
+++ b/dotnet/QrCodeGenerator/QrCode.cs
@@ -1,5 +1,5 @@
/*
- * QR Code generator library (.NET)
+ * QR code generator library (.NET)
*
* Copyright (c) Project Nayuki. (MIT License)
* https://www.nayuki.io/page/qr-code-generator-library
@@ -33,26 +33,35 @@ using System.Text;
namespace IO.Nayuki.QrCodeGen
{
///
- /// A QR Code symbol, which is a type of two-dimension barcode.
+ /// Represents a QR code containing text or binary data.
+ ///
+ /// Instances of this class represent an immutable square grid of black and white pixels
+ /// (called modules by the QR code specification).
+ /// Static factory methods are provided to create QR codes from text or binary data.
+ /// Some of the methods provide detailed control about the encoding parameters such a QR
+ /// code size (called version by the standard), error correction level and mask.
+ ///
+ ///
+ /// QR codes are a type of two-dimensional barcodes, invented by Denso Wave and
+ /// described in the ISO/IEC 18004 standard.
+ ///
+ ///
+ /// This class covers the QR Code Model 2 specification, supporting all versions (sizes)
+ /// from 1 to 40, all 4 error correction levels, and 4 character encoding modes.
///
///
- /// Invented by Denso Wave and described in the ISO/IEC 18004 standard.
- /// araInstances of this class represent an immutable square grid of black and white cells.
- /// The class provides static factory functions to create a QR Code from text or binary data.
- /// The class covers the QR Code Model 2 specification, supporting all versions (sizes)
- /// from 1 to 40, all 4 error correction levels, and 4 character encoding modes.
- /// Ways to create a QR Code object:
+ ///
+ /// To create a QR code instance:
+ ///
///
///
High level: Take the payload data and call
- /// or .
- ///
Mid level: Custom-make the list of
- /// and call or
- ///
- ///
Low level: Custom-make the array of data codeword bytes (including segment headers and
- /// final padding, excluding error correction codewords), supply the appropriate version number,
- /// and call the .
+ /// or .
+ ///
Mid level: Custom-make a list of instances and call
+ ///
+ ///
Low level: Custom-make an array of data codeword bytes (including segment headers and
+ /// final padding, excluding error correction codewords), supply the appropriate version number,
+ /// and call the .
///
- /// (Note that all ways require supplying the desired error correction level.)
///
///
public class QrCode
@@ -60,20 +69,20 @@ namespace IO.Nayuki.QrCodeGen
#region Static factory functions (high level)
///
- /// Returns a QR Code representing the specified Unicode text string at the specified error correction level.
+ /// Creates a QR code representing the specified text using the specified error correction level.
+ ///
+ /// As a conservative upper bound, this function is guaranteed to succeed for strings with up to 738
+ /// Unicode code points (not UTF-16 code units) if the low error correction level is used. The smallest possible
+ /// QR code version (size) is automatically chosen. The resulting ECC level will be higher than the one
+ /// specified if it can be achieved without increasing the size (version).
+ ///
///
- ///
- /// As a conservative upper bound, this function is guaranteed to succeed for strings that have 738 or fewer
- /// Unicode code points(not UTF-16 code units) if the low error correction level is used.The smallest possible
- /// QR Code version is automatically chosen for the output.The ECC level of the result may be higher than the
- /// ecl argument if it can be done without increasing the version.
- ///
- /// the text to be encoded (not null), which can be any Unicode string
- /// the error correction level to use (not null) (boostable)
- /// a QR Code (not null) representing the text
- /// Thrown if the text or error correction level is null
- /// Thrown if the text fails to fit in the
- /// largest version QR Code at the ECL, which means it is too long
+ /// The text to be encoded. The full range of Unicode characters may be used.
+ /// The minimum error correction level to use.
+ /// The created QR code instance representing the specified text.
+ /// or is null.
+ /// The text is too long to fit in the largest QR code size (version)
+ /// at the specified error correction level.
public static QrCode EncodeText(string text, Ecc ecl)
{
Objects.RequireNonNull(text);
@@ -83,19 +92,19 @@ namespace IO.Nayuki.QrCodeGen
}
///
- /// Returns a QR Code representing the specified binary data at the specified error correction level.
+ /// Creates a QR code representing the specified binary data using the specified error correction level.
+ ///
+ /// This function encodes the data in the binary segment mode. The maximum number of
+ /// bytes allowed is 2953. The smallest possible QR code version is automatically chosen.
+ /// The resulting ECC level will be higher than the one specified if it can be achieved without increasing the size (version).
+ ///
///
- ///
- /// This function always encodes using the binary segment mode, not any text mode. The maximum number of
- /// bytes allowed is 2953. The smallest possible QR Code version is automatically chosen for the output.
- /// The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.
- ///
- /// the binary data to encode (not null)
- /// the error correction level to use (not null) (boostable)
- /// a QR Code (not null) representing the data
- /// Thrown if the data or error correction level is null
- /// Thrown if the data fails to fit in the
- /// largest version QR Code at the ECL, which means it is too long
+ /// The binary data to encode.
+ /// The minimum error correction level to use.
+ /// The created QR code representing the specified data.
+ /// or is null.
+ /// The specified data is too long to fit in the largest QR code size (version)
+ /// at the specified error correction level.
public static QrCode EncodeBinary(byte[] data, Ecc ecl)
{
Objects.RequireNonNull(data);
@@ -110,56 +119,44 @@ namespace IO.Nayuki.QrCodeGen
#region Static factory functions (mid level)
///
- /// Returns a QR Code representing the specified segments at the specified error correction level.
- ///
- ///
- /// The smallest possible QR Code version is automatically chosen for the output. The ECC level
- /// of the result may be higher than the ecl argument if it can be done without increasing the version.
- /// This function allows the user to create a custom sequence of segments that switches
- /// between modes (such as alphanumeric and byte) to encode text in less space.
- /// This is a mid-level API; the high-level API is
- /// and
- ///
- /// the segments to encode
- /// the error correction level to use (not null) (boostable)
- /// a QR Code (not null) representing the segments
- /// Thrown if the data or error correction level is null
- /// Thrown if the segments fail to fit in the
- /// largest version QR Code at the ECL, which means it is too long
- public static QrCode EncodeSegments(List segs, Ecc ecl)
- {
- return EncodeSegments(segs, ecl, MinVersion, MaxVersion, -1, true);
- }
-
- ///
- /// Returns a QR Code representing the specified segments with the specified encoding parameters.
+ /// Creates a QR code representing the specified segments with the specified encoding parameters.
+ ///
+ /// The smallest possible QR code version (size) is used. The range of versions can be
+ /// restricted by the and parameters.
+ ///
+ ///
+ /// If is true, the resulting ECC level will be higher than the
+ /// one specified if it can be achieved without increasing the size (version).
+ ///
+ ///
+ /// The QR code mask is usually automatically chosen. It can be explicitly set with the
+ /// parameter by using a value between 0 to 7 (inclusive). -1 is for automatic mode (which may be slow).
+ ///
+ ///
+ /// This function allows the user to create a custom sequence of segments that switches
+ /// between modes (such as alphanumeric and byte) to encode text in less space and gives full control over all
+ /// encoding paramters.
+ ///
///
///
- /// The smallest possible QR Code version within the specified range is automatically
- /// chosen for the output. Iff boostEcl is true, then the ECC level of the
- /// result may be higher than the ecl argument if it can be done without increasing
- /// the version. The mask number is either between 0 to 7 (inclusive) to force that
- /// mask, or −1 to automatically choose an appropriate mask (which may be slow).
- /// This function allows the user to create a custom sequence of segments that switches
- /// between modes (such as alphanumeric and byte) to encode text in less space.
- /// This is a mid-level API; the high-level API is
- /// and .
+ /// This is a mid-level API; the high-level APIs are
+ /// and .
///
- /// the segments to encode
- /// the error correction level to use (not null) (boostable)
- /// the minimum allowed version of the QR Code (at least 1)
- /// the maximum allowed version of the QR Code (at most 40)
- /// the mask number to use (between 0 and 7 (inclusive)), or −1 for automatic mask
- /// increases the ECC level as long as it doesn't increase the version number
- /// a QR Code (not null) representing the segments
- /// Thrown if the list of segments, any segment, or the error correction level is null
- /// Thrown if 1 ≤ minVersion ≤ maxVersion ≤ 40
- /// or −1 ≤ mask ≤ 7 is violated
- /// Thrown DataTooLongException if the segments fail to fit in
- /// the maxVersion QR Code at the ECL, which means they are too long
- public static QrCode EncodeSegments(List segs, Ecc ecl, int minVersion, int maxVersion, int mask, bool boostEcl)
+ /// The segments to encode.
+ /// The minimal or fixed error correction level to use .
+ /// The minimum version (size) of the QR code (between 1 and 40).
+ /// The maximum version (size) of the QR code (between 1 and 40).
+ /// The mask number to use (between 0 and 7), or -1 for automatic mask selection.
+ /// If true the ECC level wil be increased if it can be achieved without increasing the size (version).
+ /// The created QR code representing the segments.
+ /// , any list element, or is null.
+ /// 1 ≤ minVersion ≤ maxVersion ≤ 40
+ /// or -1 ≤ mask ≤ 7 is violated.
+ /// The segments are too long to fit in the largest QR code size (version)
+ /// at the specified error correction level.
+ public static QrCode EncodeSegments(List segments, Ecc ecl, int minVersion = MinVersion, int maxVersion = MaxVersion, int mask = -1, bool boostEcl = true)
{
- Objects.RequireNonNull(segs);
+ Objects.RequireNonNull(segments);
Objects.RequireNonNull(ecl);
if (minVersion < MinVersion || minVersion > maxVersion)
{
@@ -179,7 +176,7 @@ namespace IO.Nayuki.QrCodeGen
for (version = minVersion; ; version++)
{
int numDataBits = GetNumDataCodewords(version, ecl) * 8; // Number of data bits available
- dataUsedBits = QrSegment.GetTotalBits(segs, version);
+ dataUsedBits = QrSegment.GetTotalBits(segments, version);
if (dataUsedBits != -1 && dataUsedBits <= numDataBits)
{
break; // This version number is found to be suitable
@@ -209,7 +206,7 @@ namespace IO.Nayuki.QrCodeGen
// Concatenate all segments to create the data bit string
BitArray ba = new BitArray(0);
- foreach (QrSegment seg in segs)
+ foreach (QrSegment seg in segments)
{
ba.AppendBits(seg.EncodingMode.ModeBits, 4);
ba.AppendBits((uint)seg.NumChars, seg.EncodingMode.NumCharCountBits(version));
@@ -240,7 +237,7 @@ namespace IO.Nayuki.QrCodeGen
}
}
- // Create the QR Code object
+ // Create the QR code object
return new QrCode(version, ecl, dataCodewords, mask);
}
@@ -250,28 +247,33 @@ namespace IO.Nayuki.QrCodeGen
#region Public immutable properties
///
- /// The version number of this QR Code, which is between 1 and 40 (inclusive).
- /// This determines the size of this barcode.
+ /// The version (size) of this QR code (between 1 for the smallest and 40 for the biggest).
///
+ /// The QR code version (size).
public int Version { get; }
///
- /// The width and height of this QR Code, measured in modules, between
- /// 21 and 177 (inclusive). This is equal to version × 4 + 17.
+ /// The width and height of this QR code, in modules (pixels).
+ /// The size is a value between 21 and 177.
+ /// This is equal to version × 4 + 17.
///
+ /// The QR code size.
public int Size { get; }
///
- /// The error correction level used in this QR Code, which is not null.
+ /// The error correction level used for this QR code.
///
+ /// The error correction level.
public Ecc ErrorCorrectionLevel { get; }
///
- /// The index of the mask pattern used in this QR Code, which is between 0 and 7 (inclusive).
+ /// The index of the mask pattern used fort this QR code (between 0 and 7).
+ ///
+ /// Even if a QR code is created with automatic mask selection (mask = 1),
+ /// this property returns the effective mask used.
+ ///
///
- /// Even if a QR Code is created with automatic masking requested (mask =
- /// −1), the resulting object still has a mask value between 0 and 7.
- ///
+ /// The mask pattern index.
public int Mask { get; }
#endregion
@@ -279,8 +281,8 @@ namespace IO.Nayuki.QrCodeGen
#region Private grids of modules/pixels, with dimensions of size * size
- // The modules of this QR Code (false = white, true = black).
- // Immutable after constructor finishes. Accessed through getModule().
+ // The modules of this QR code (false = white, true = black).
+ // Immutable after constructor finishes. Accessed through GetModule().
private readonly bool[,] _modules;
// Indicates function modules that are not subjected to masking. Discarded when constructor finishes.
@@ -292,26 +294,26 @@ namespace IO.Nayuki.QrCodeGen
#region Constructor (low level)
///
- /// Constructs a QR Code with the specified version number,
+ /// Constructs a QR code with the specified version number,
/// error correction level, data codeword bytes, and mask number.
///
///
/// This is a low-level API that most users should not use directly. A mid-level
- /// API is the function.
+ /// API is the function.
///
- /// the version number to use, which must be in the range 1 to 40 (inclusive)
- /// the error correction level to use
- /// the bytes representing segments to encode (without ECC)
- /// the mask pattern to use, which is either −1 for automatic choice or from 0 to 7 for fixed choice
- /// Thrown if the byte array or error correction level is null
- /// Thrown if the version or mask value is out of range,
- /// or if the data is the wrong length for the specified version and error correction level
- public QrCode(int ver, Ecc ecl, byte[] dataCodewords, int mask)
+ /// The version (size) to use (between 1 to 40).
+ /// The error correction level to use.
+ /// The bytes representing segments to encode (without ECC).
+ /// The mask pattern to use (either -1 for automatic selection, or a value from 0 to 7 for fixed choice).
+ /// or is null.
+ /// The version or mask value is out of range,
+ /// or the data has an invalid length for the specified version and error correction level.
+ public QrCode(int version, Ecc ecl, byte[] dataCodewords, int mask = -1)
{
// Check arguments and initialize fields
- if (ver < MinVersion || ver > MaxVersion)
+ if (version < MinVersion || version > MaxVersion)
{
- throw new ArgumentOutOfRangeException(nameof(ver), "Version value out of range");
+ throw new ArgumentOutOfRangeException(nameof(version), "Version value out of range");
}
if (mask < -1 || mask > 7)
@@ -319,8 +321,8 @@ namespace IO.Nayuki.QrCodeGen
throw new ArgumentOutOfRangeException(nameof(mask), "Mask value out of range");
}
- Version = ver;
- Size = ver * 4 + 17;
+ Version = version;
+ Size = version * 4 + 17;
Objects.RequireNonNull(ecl);
ErrorCorrectionLevel = ecl;
Objects.RequireNonNull(dataCodewords);
@@ -342,18 +344,19 @@ namespace IO.Nayuki.QrCodeGen
#region Public methods
///
- /// Returns the color of the module (pixel) at the specified coordinates, which is false
- /// for white or true for black.
+ /// Gets the color of the module (pixel) at the specified coordinates.
+ ///
+ /// The top left corner has the coordinates (x=0, y=0). x-coordinates extend from left to right,
+ /// y-coordinates extend from top to bottom.
+ ///
+ ///
+ /// If coordinates outside the bounds of this QR code are specified, white (false) is returned.
+ ///
///
- ///
- /// The top left corner has the coordinates (x=0, y=0).
- /// If the specified coordinates are out of bounds, then false
- /// (white) is returned.
- ///
- /// the x coordinate, where 0 is the left edge and size−1 is the right edge
- /// the y coordinate, where 0 is the top edge and size−1 is the bottom edge
- /// true if the coordinates are in bounds and the module
- /// at that location is black, or false (white) otherwise
+ /// The x coordinate.
+ /// The y coordinate.
+ /// The color of the specified module: true for black modules and false
+ /// for white modules (or if the coordinates are outside the bounds).
public bool GetModule(int x, int y)
{
return 0 <= x && x < Size && 0 <= y && y < Size && _modules[y, x];
@@ -361,18 +364,26 @@ namespace IO.Nayuki.QrCodeGen
///
- /// Returns a bitmap (raster image) depicting this QR Code, with the specified module scale and border modules.
- ///
- ///
- /// For example, ToBitmap(scale: 10, border: 4) means to pad the QR Code with 4 white
+ /// Creates a bitmap (raster image) of this QR code.
+ ///
+ /// The parameter specifies the scale of the image, which is
+ /// equivalent to the width and height of each QR code module. Additionally, the number
+ /// of modules to add as a border to all four sides can be specified.
+ ///
+ ///
+ /// For example, ToBitmap(scale: 10, border: 4) means to pad the QR code with 4 white
/// border modules on all four sides, and use 10×10 pixels to represent each module.
- /// The resulting image only contains the hex colors 000000 and FFFFFF.
- ///
- /// the side length (measured in pixels, must be positive) of each module
- /// the number of border modules to add, which must be non-negative
- /// a new image representing this QR Code, with padding and scaling
- /// Thrown if the scale is 0 or negative, if the border is negative
- /// or if the resulting image is wider than 32,768 pixels
+ ///
+ ///
+ /// The resulting bitmap uses the pixel format and
+ /// only contains black (0x000000) and white (0xFFFFFF) pixels.
+ ///
+ ///
+ /// The width and height, in pixels, of each module.
+ /// The number of border modules to add to each of the four sides.
+ /// The created bitmap representing this QR code.
+ /// is 0 or negative, is negative
+ /// or the resulting image is wider than 32,768 pixels.
public Bitmap ToBitmap(int scale, int border)
{
if (scale <= 0)
@@ -408,14 +419,14 @@ namespace IO.Nayuki.QrCodeGen
///
- /// Returns a string of SVG code for an image depicting this QR Code, with the specified number of border modules.
+ /// Creates an SVG image of this QR code.
+ ///
+ /// The images uses Unix newlines (\n), regardless of the platform.
+ ///
///
- ///
- /// The string always uses Unix newlines (\n), regardless of the platform.
- ///
- /// the number of border modules to add, which must be non-negative
- /// a string representing this QR Code as an SVG XML document
- /// Thrown if the border is negative
+ /// The number of border modules to add on all four sides.
+ /// The created SVG XML document of this QR code as a string.
+ /// is negative.
public string ToSvgString(int border)
{
if (border < 0)
@@ -424,23 +435,22 @@ namespace IO.Nayuki.QrCodeGen
}
int dim = Size + border * 2;
- var sb = new StringBuilder()
+ StringBuilder sb = new StringBuilder()
.Append("\n")
.Append("\n")
.Append($"