diQRcodeNet Namespace

.NET interface to diQRcode.

Classes

Class Description
QRcode Create a QR code image.

Enumerations

Enumeration Description
Ecc Error correction code level
ImageType Image type
Options Option flags

QRcode Class

Create a QR code image.

Inheritance Hierarchy

System.Object
diQRcodeNet.QRcode

Namespace: diQRcodeNet
Assembly: diQRcodeNet (in diQRcodeNet.dll) Version: 4.0.0.36607 (4.0.0.1)

Syntax

public class QRcode

The QRcode type exposes the following members.

Methods

Name Description
CreateGif Create a GIF file of a QR code [deprecated].
CreateGifInUtf8 Create a GIF file of a QR code, using UTF-8 encoding [deprecated].
CreateImage Create an image file of a QR code.
CreateImageInUtf8 Create an image file of a QR code, using UTF-8 encoding.
CreatePdf Create a PDF file of a QR code.
CreatePdfInUtf8 Create a PDF file of a QR code, using UTF-8 encoding.
DllInfo Get information about the core diQRcode DLL.
ErrorLookup Look up description for error code.
NetVersion Return the version of this .NET module.
Version Get version number of core diQRcode DLL.

See Also

diQRcodeNet Namespace

QRcode.CreateGif Method

Create a GIF file of a QR code [deprecated].

Namespace: diQRcodeNet
Assembly: diQRcodeNet (in diQRcodeNet.dll) Version: 4.0.0.36607 (4.0.0.1)

Syntax

public static int CreateGif(
    string outFile,
    string inputStr,
    int nPixelsPerModule = 0,
    Ecc level = Ecc.M,
    string paramStr = "",
    Options options = Options.Default
)

Parameters

outFile String

Name of output GIF file to be created.

inputStr String

Text input to be encoded (ANSI characters only).

nPixelsPerModule Int32 (Optional)

Number of pixels per module (default = 2 ppm)

level Ecc (Optional)

Error correction level (default = M)

paramStr String (Optional)

Optional parameter string. Set as "margin=N" to change the margin to N modules (default=4).

options Options (Optional)

Set as Escaped to indicate #-escaped sequences in the input string.

Return Value

Int32
Zero on success, or a nonzero error code.

Remarks

Deprecated. Use QRCode.CreateImage

Example

int n = QRcode.CreateGif("hello.gif", "hello world");
if (n != 0) Console.WriteLine("Error: {0}", QRcode.ErrorLookup(n));

See Also

QRcode Class
diQRcodeNet Namespace

QRcode.CreateGifInUtf8 Method

Create a GIF file of a QR code, using UTF-8 encoding [deprecated].

Namespace: diQRcodeNet
Assembly: diQRcodeNet (in diQRcodeNet.dll) Version: 4.0.0.36607 (4.0.0.1)

Syntax

public static int CreateGifInUtf8(
    string outFile,
    string inputStr,
    int nPixelsPerModule = 0,
    Ecc level = Ecc.M,
    string paramStr = "",
    Options options = Options.Default
)

Parameters

outFile String

Name of output GIF file to be created.

inputStr String

Text input to be encoded.

nPixelsPerModule Int32 (Optional)

Number of pixels per module (default = 2 ppm)

level Ecc (Optional)

Error correction code level (default = M)

paramStr String (Optional)

Optional parameter string. Set as "margin=N" to change the margin to N modules (default=4).

options Options (Optional)

Option flags.

Return Value

Int32
Zero on success, or a nonzero error code.

Remarks

Any non-ASCII characters in inputStr will be encoded in UTF-8 before processing. Deprecated. Use QRCode.CreateImageInUtf8

See Also

QRcode Class
diQRcodeNet Namespace

QRcode.CreateImage Method

Create an image file of a QR code.

Namespace: diQRcodeNet
Assembly: diQRcodeNet (in diQRcodeNet.dll) Version: 4.0.0.36607 (4.0.0.1)

Syntax

public static int CreateImage(
    string outFile,
    string inputStr,
    ImageType imageType = ImageType.Gif,
    int nPixelsPerModule = 0,
    int margin = 0,
    Ecc level = Ecc.M,
    Options options = Options.Default
)

Parameters

outFile String

Name of output image file to be created.

inputStr String

Text input to be encoded (ANSI characters only).

imageType ImageType (Optional)

Image type (GIF/SVG) (default = GIF).

nPixelsPerModule Int32 (Optional)

Number of pixels per module (default = 2 ppm).

margin Int32 (Optional)

Size of margin in modules (default = 4 modules).

level Ecc (Optional)

Error correction level (default = M).

options Options (Optional)

Set as Escaped to indicate #-escaped sequences in the input string.

Return Value

Int32
Zero on success, or a nonzero error code.

Example

int n = QRcode.CreateImage("hello.gif", "hello world");
if (n != 0) Console.WriteLine("Error: {0}", QRcode.ErrorLookup(n));
n = QRcode.CreateImage("hello.svg", "hello world", ImageType.Svg);
if (n != 0) Console.WriteLine("Error: {0}", QRcode.ErrorLookup(n));

See Also

QRcode Class
diQRcodeNet Namespace

QRcode.CreateImageInUtf8 Method

Create an image file of a QR code, using UTF-8 encoding.

Namespace: diQRcodeNet
Assembly: diQRcodeNet (in diQRcodeNet.dll) Version: 4.0.0.36607 (4.0.0.1)

Syntax

public static int CreateImageInUtf8(
    string outFile,
    string inputStr,
    ImageType imageType = ImageType.Gif,
    int nPixelsPerModule = 0,
    int margin = 0,
    Ecc level = Ecc.M,
    Options options = Options.Default
)

Parameters

outFile String

Name of output image file to be created.

inputStr String

Text input to be encoded.

imageType ImageType (Optional)

Image type (GIF/SVG) (default = GIF).

nPixelsPerModule Int32 (Optional)

Number of pixels per module (default = 2 ppm)

margin Int32 (Optional)

Size of margin in modules (default = 4 modules).

level Ecc (Optional)

Error correction code level (default = M)

options Options (Optional)

Option flags.

Return Value

Int32
Zero on success, or a nonzero error code.

Remarks

Any non-ASCII characters in inputStr will be encoded in UTF-8 before processing.

Example

n = QRcode.CreateImageInUtf8("zz-utf8.svg", "中国", ImageType.Svg);

See Also

QRcode Class
diQRcodeNet Namespace

QRcode.CreatePdf Method

Create a PDF file of a QR code.

Namespace: diQRcodeNet
Assembly: diQRcodeNet (in diQRcodeNet.dll) Version: 4.0.0.36607 (4.0.0.1)

Syntax

public static int CreatePdf(
    string outFile,
    string inputStr,
    int nPixelsPerModule = 0,
    Ecc level = Ecc.M,
    int nPageWidth = 0,
    int nPageHeight = 0,
    int nX = 0,
    int nY = 0,
    Options options = Options.Default
)

Parameters

outFile String

Name of output PDF file to be created.

inputStr String

Text input to be encoded.

nPixelsPerModule Int32 (Optional)

Number of pixels per module (default = 2 ppm)

level Ecc (Optional)

Error correction code level (default = M)

nPageWidth Int32 (Optional)

Width of PDF page in pixels (default = 0 => set width to fit QRcode image).

nPageHeight Int32 (Optional)

Height of PDF page in pixels (default = 0 => set height to fit QRcode image).

nX Int32 (Optional)

X-coordinate in pixels of bottom-left of QRcode image (default = 0 => at left side).

nY Int32 (Optional)

Y-coordinate in pixels of bottom-left of QRcode image (default = 0 => at bottom).

options Options (Optional)

Option flags.

Return Value

Int32
Zero on success, or a nonzero error code.

Example

n = QRcode.CreatePdf("hello0.pdf", "Hello world!");
n = QRcode.CreatePdf("helloA4.pdf", "Hello world!", nPixelsPerModule: 6, nPageWidth: 595, nPageHeight: 842, nX: 230, nY: 380);

See Also

QRcode Class
diQRcodeNet Namespace

QRcode.CreatePdfInUtf8 Method

Create a PDF file of a QR code, using UTF-8 encoding.

Namespace: diQRcodeNet
Assembly: diQRcodeNet (in diQRcodeNet.dll) Version: 4.0.0.36607 (4.0.0.1)

Syntax

public static int CreatePdfInUtf8(
    string outFile,
    string inputStr,
    int nPixelsPerModule = 0,
    Ecc level = Ecc.M,
    int nPageWidth = 0,
    int nPageHeight = 0,
    int nX = 0,
    int nY = 0,
    Options options = Options.Default
)

Parameters

outFile String

Name of output PDF file to be created.

inputStr String

Text input to be encoded.

nPixelsPerModule Int32 (Optional)

Number of pixels per module (default = 2 ppm)

level Ecc (Optional)

Error correction code level (default = M)

nPageWidth Int32 (Optional)

Width of PDF page in pixels (default = 0 => set width to fit QRcode image).

nPageHeight Int32 (Optional)

Height of PDF page in pixels (default = 0 => set height to fit QRcode image).

nX Int32 (Optional)

X-coordinate in pixels of bottom-left of QRcode image (default = 0 => at left side).

nY Int32 (Optional)

Y-coordinate in pixels of bottom-left of QRcode image (default = 0 => at bottom).

options Options (Optional)

Option flags.

Return Value

Int32
Zero on success, or a nonzero error code.

Remarks

Any non-ASCII characters in inputStr will be encoded in UTF-8 before processing.

See Also

QRcode Class
diQRcodeNet Namespace

QRcode.DllInfo Method

Get information about the core diQRcode DLL.

Namespace: diQRcodeNet
Assembly: diQRcodeNet (in diQRcodeNet.dll) Version: 4.0.0.36607 (4.0.0.1)

Syntax

public static string DllInfo()

Return Value

String
String with information including platform core DLL is compiled for: Win32 or X64.

See Also

QRcode Class
diQRcodeNet Namespace

QRcode.ErrorLookup Method

Look up description for error code.

Namespace: diQRcodeNet
Assembly: diQRcodeNet (in diQRcodeNet.dll) Version: 4.0.0.36607 (4.0.0.1)

Syntax

public static string ErrorLookup(
    int errCode
)

Parameters

errCode Int32

Value of error code to lookup (may be positive or negative)

Return Value

String
Error message, or empty string if no corresponding error code.

Example

Console.WriteLine(QRcode.ErrorLookup(-39));  // Unable to encode

See Also

QRcode Class
diQRcodeNet Namespace

QRcode.NetVersion Method

Return the version of this .NET module.

Namespace: diQRcodeNet
Assembly: diQRcodeNet (in diQRcodeNet.dll) Version: 4.0.0.36607 (4.0.0.1)

Syntax

public static string NetVersion()

Return Value

String
Version string, e.g. "03.05.00"

See Also

QRcode Class
diQRcodeNet Namespace

QRcode.Version Method

Get version number of core diQRcode DLL.

Namespace: diQRcodeNet
Assembly: diQRcodeNet (in diQRcodeNet.dll) Version: 4.0.0.36607 (4.0.0.1)

Syntax

public static int Version()

Return Value

Int32
Version number in form Major * 10000 + Minor * 100 + Release

Remarks

For example, version 1.2.3 would return 10203

See Also

QRcode Class
diQRcodeNet Namespace

Ecc Enumeration

Error correction code level

Namespace: diQRcodeNet
Assembly: diQRcodeNet (in diQRcodeNet.dll) Version: 4.0.0.36607 (4.0.0.1)

Syntax

public enum Ecc

Members

Member name Description
M EC level M (default)
L EC level L
Q EC level Q
H EC level H

See Also

diQRcodeNet Namespace

ImageType Enumeration

Image type

Namespace: diQRcodeNet
Assembly: diQRcodeNet (in diQRcodeNet.dll) Version: 4.0.0.36607 (4.0.0.1)

Syntax

public enum ImageType

Members

Member name Description
Gif Output image as a GIF file (default)
Svg Output image as an SVG file

See Also

diQRcodeNet Namespace

Options Enumeration

Option flags

Namespace: diQRcodeNet
Assembly: diQRcodeNet (in diQRcodeNet.dll) Version: 4.0.0.36607 (4.0.0.1)

Syntax

[FlagsAttribute]
public enum Options

Members

Member name Description
Default Default options.
Escaped Input string contains #-escaped sequences.
Base64 Encode image output formatted as base64 text.
NoNameCheck Do not check filename extension against file type.

See Also

diQRcodeNet Namespace


Created: 2025-10-20 20:20:52
Copyright (C) 2025 D.I. Management Services Pty Ltd t/a CryptoSys https://cryptosys.net