Class QRCodeGenerator
Implements
Inherited Members
Namespace: QRCoder
Assembly: Subsembly.Scraper.dll
Syntax
public class QRCodeGenerator : IDisposable
Constructors
QRCodeGenerator()
Initializes the QR code generator
Declaration
public QRCodeGenerator()
Methods
CreateQrCode(Payload)
Calculates the QR code data which than can be used in one of the rendering classes to generate a graphical representation.
Declaration
public QRCodeData CreateQrCode(PayloadGenerator.Payload payload)
Parameters
Type | Name | Description |
---|---|---|
PayloadGenerator.Payload | payload | A payload object, generated by the PayloadGenerator-class |
Returns
Type | Description |
---|---|
QRCodeData | Returns the raw QR code data which can be used for rendering. |
Exceptions
Type | Condition |
---|---|
DataTooLongException | Thrown when the payload is too big to be encoded in a QR code. |
CreateQrCode(Payload, ECCLevel)
Calculates the QR code data which than can be used in one of the rendering classes to generate a graphical representation.
Declaration
public QRCodeData CreateQrCode(PayloadGenerator.Payload payload, QRCodeGenerator.ECCLevel eccLevel)
Parameters
Type | Name | Description |
---|---|---|
PayloadGenerator.Payload | payload | A payload object, generated by the PayloadGenerator-class |
QRCodeGenerator.ECCLevel | eccLevel | The level of error correction data |
Returns
Type | Description |
---|---|
QRCodeData | Returns the raw QR code data which can be used for rendering. |
Exceptions
Type | Condition |
---|---|
DataTooLongException | Thrown when the payload is too big to be encoded in a QR code. |
CreateQrCode(byte[], ECCLevel)
Calculates the QR code data which than can be used in one of the rendering classes to generate a graphical representation.
Declaration
public QRCodeData CreateQrCode(byte[] binaryData, QRCodeGenerator.ECCLevel eccLevel)
Parameters
Type | Name | Description |
---|---|---|
byte[] | binaryData | A byte array which shall be encoded/stored in the QR code |
QRCodeGenerator.ECCLevel | eccLevel | The level of error correction data |
Returns
Type | Description |
---|---|
QRCodeData | Returns the raw QR code data which can be used for rendering. |
Exceptions
Type | Condition |
---|---|
DataTooLongException | Thrown when the payload is too big to be encoded in a QR code. |
CreateQrCode(string, ECCLevel, bool, bool, EciMode, int)
Calculates the QR code data which than can be used in one of the rendering classes to generate a graphical representation.
Declaration
public QRCodeData CreateQrCode(string plainText, QRCodeGenerator.ECCLevel eccLevel, bool forceUtf8 = false, bool utf8BOM = false, QRCodeGenerator.EciMode eciMode = EciMode.Default, int requestedVersion = -1)
Parameters
Type | Name | Description |
---|---|---|
string | plainText | The payload which shall be encoded in the QR code |
QRCodeGenerator.ECCLevel | eccLevel | The level of error correction data |
bool | forceUtf8 | Shall the generator be forced to work in UTF-8 mode? |
bool | utf8BOM | Should the byte-order-mark be used? |
QRCodeGenerator.EciMode | eciMode | Which ECI mode shall be used? |
int | requestedVersion | Set fixed QR code target version. |
Returns
Type | Description |
---|---|
QRCodeData | Returns the raw QR code data which can be used for rendering. |
Exceptions
Type | Condition |
---|---|
DataTooLongException | Thrown when the payload is too big to be encoded in a QR code. |
Dispose()
Declaration
public void Dispose()
GenerateQrCode(Payload)
Calculates the QR code data which than can be used in one of the rendering classes to generate a graphical representation.
Declaration
public static QRCodeData GenerateQrCode(PayloadGenerator.Payload payload)
Parameters
Type | Name | Description |
---|---|---|
PayloadGenerator.Payload | payload | A payload object, generated by the PayloadGenerator-class |
Returns
Type | Description |
---|---|
QRCodeData | Returns the raw QR code data which can be used for rendering. |
Exceptions
Type | Condition |
---|---|
DataTooLongException | Thrown when the payload is too big to be encoded in a QR code. |
GenerateQrCode(Payload, ECCLevel)
Calculates the QR code data which than can be used in one of the rendering classes to generate a graphical representation.
Declaration
public static QRCodeData GenerateQrCode(PayloadGenerator.Payload payload, QRCodeGenerator.ECCLevel eccLevel)
Parameters
Type | Name | Description |
---|---|---|
PayloadGenerator.Payload | payload | A payload object, generated by the PayloadGenerator-class |
QRCodeGenerator.ECCLevel | eccLevel | The level of error correction data |
Returns
Type | Description |
---|---|
QRCodeData | Returns the raw QR code data which can be used for rendering. |
Exceptions
Type | Condition |
---|---|
DataTooLongException | Thrown when the payload is too big to be encoded in a QR code. |
GenerateQrCode(byte[], ECCLevel)
Calculates the QR code data which than can be used in one of the rendering classes to generate a graphical representation.
Declaration
public static QRCodeData GenerateQrCode(byte[] binaryData, QRCodeGenerator.ECCLevel eccLevel)
Parameters
Type | Name | Description |
---|---|---|
byte[] | binaryData | A byte array which shall be encoded/stored in the QR code |
QRCodeGenerator.ECCLevel | eccLevel | The level of error correction data |
Returns
Type | Description |
---|---|
QRCodeData | Returns the raw QR code data which can be used for rendering. |
Exceptions
Type | Condition |
---|---|
DataTooLongException | Thrown when the payload is too big to be encoded in a QR code. |
GenerateQrCode(string, ECCLevel, bool, bool, EciMode, int)
Calculates the QR code data which than can be used in one of the rendering classes to generate a graphical representation.
Declaration
public static QRCodeData GenerateQrCode(string plainText, QRCodeGenerator.ECCLevel eccLevel, bool forceUtf8 = false, bool utf8BOM = false, QRCodeGenerator.EciMode eciMode = EciMode.Default, int requestedVersion = -1)
Parameters
Type | Name | Description |
---|---|---|
string | plainText | The payload which shall be encoded in the QR code |
QRCodeGenerator.ECCLevel | eccLevel | The level of error correction data |
bool | forceUtf8 | Shall the generator be forced to work in UTF-8 mode? |
bool | utf8BOM | Should the byte-order-mark be used? |
QRCodeGenerator.EciMode | eciMode | Which ECI mode shall be used? |
int | requestedVersion | Set fixed QR code target version. |
Returns
Type | Description |
---|---|
QRCodeData | Returns the raw QR code data which can be used for rendering. |
Exceptions
Type | Condition |
---|---|
DataTooLongException | Thrown when the payload is too big to be encoded in a QR code. |