diQRcode
4.0.0
|
The C/C++ interface to the diQRcode.dll library. More...
Macros | |
#define | QRCODE_ECC_M 0 |
Error correction level M (default) | |
#define | QRCODE_ECC_L 1 |
Error correction level L. | |
#define | QRCODE_ECC_Q 2 |
Error correction level Q. | |
#define | QRCODE_ECC_H 3 |
Error correction level H. | |
#define | QRCODE_ESCAPED 0x1000L |
Input string contains #-escaped sequences. | |
#define | QRCODE_BASE64 0x2000L |
Encode image output formatted as base64 text. | |
#define | QRCODE_NO_NAMECHECK 0x10000L |
Do not check filename extension against file type. | |
#define | QRCODE_IMAGE_GIF 0x00 |
Output image as a GIF file (default) | |
#define | QRCODE_IMAGE_SVG 0x10 |
Output image as an SVG file. | |
Functions | |
long | QRCODE_CreateImage (const char *szOutputFile, const char *szInput, long nPixelsPerModule, long nMargin, long nOptions) |
Create an image file of a QR code. More... | |
long | QRCODE_CreateGif (const char *szOutputFile, const char *szInput, long nPixelsPerModule, const char *szParams, long nOptions) |
Create a GIF file of a QR code. More... | |
long | QRCODE_CreatePdf (const char *szOutputFile, const char *szInput, long nPixelsPerModule, long nPageWidth, long nPageHeight, long nX, long nY, long nOptions) |
Create a PDF file of a QR code. More... | |
long | QRCODE_Version (void) |
Get version number of the core DLL. More... | |
long | QRCODE_DllInfo (char *szOutput, long nOutChars, long nOptions) |
Get information about the core diQRcode DLL. More... | |
long | QRCODE_ErrorLookup (char *szOutput, long nOutChars, long nErrCode) |
Look up description for error code. More... | |
The C/C++ interface to the diQRcode.dll library.
szOut
require the buffer to be allocated to at least the specified length nOutChars
PLUS one extra for the null-terminating byte. These functions always return the total length in bytes of the string they tried to create. To find the required length, pass a NULL szOut
or zero nOutChars
argument, then add one to the result for the required buffer size. #xHH
, #uHHHH
or #UHHHHHH
to represent bytes or Unicode characters in the input text, where H is a hexadecimal digit. The escaped sequence flag must be turned on: add option QRCODE_ESCAPED
. #xHH
represents the byte whose numerical value is given by HH interpreted as a hexadecimal number. The sequence will be replaced by the byte value. #uHHHH
and #UHHHHHH
represent the Unicode code points U+HHHH and U+HHHHHH, respectively. The sequence will be replaced by the UTF-8 encoding of the code point. #x0A
will be replaced by the byte 0x0A (ASCII Line Feed, LF). #u00E1
will be replaced by the UTF-8-encoding of the character U+00E1 (Latin Small Letter A with Acute). #u4E2D
by the Chinese character zhong U+4E2D, and #U01D160
by the musical symbol eighth note (U+1D160). #x
#u
and #U
is strictly enforced (exactly 2, 4 or 6, respectively). long QRCODE_CreateImage | ( | const char * | szOutputFile, |
const char * | szInput, | ||
long | nPixelsPerModule, | ||
long | nMargin, | ||
long | nOptions | ||
) |
Create an image file of a QR code.
[in] | szOutputFile | Name of output image file to be created. |
[in] | szInput | Text input to be encoded. |
[in] | nPixelsPerModule | Number of pixels per module (default = 2 ppm). |
[in] | nMargin | Size of margin in modules (default = 4 modules). |
[in] | nOptions | Option flags. Select exactly one of: QRCODE_ECC_M (0) for error correction level M (default) QRCODE_ECC_L for error correction level L QRCODE_ECC_Q for error correction level Q QRCODE_ECC_H for error correction level H and optionally add (using '|' operator): QRCODE_IMAGE_SVG to output an SVG image (default = GIF). QRCODE_ESCAPED to indicate #-escaped sequences in the input string. QRCODE_BASE64 to output the image encoded as base64 text. |
long QRCODE_CreateGif | ( | const char * | szOutputFile, |
const char * | szInput, | ||
long | nPixelsPerModule, | ||
const char * | szParams, | ||
long | nOptions | ||
) |
Create a GIF file of a QR code.
[in] | szOutputFile | Name of output GIF file to be created. |
[in] | szInput | Text input to be encoded. |
[in] | nPixelsPerModule | Number of pixels per module (default = 2 ppm). |
[in] | szParams | Optional parameters. Set as "margin=N" to change the margin to N modules (default=4). |
[in] | nOptions | Option flags. Select exactly one of: QRCODE_ECC_M (0) for error correction level M (default) QRCODE_ECC_L for error correction level L QRCODE_ECC_Q for error correction level Q QRCODE_ECC_H for error correction level H and optionally add: QRCODE_ESCAPED to indicate #-escaped sequences in the input string. QRCODE_BASE64 to output the image encoded as base64 text. |
long QRCODE_CreatePdf | ( | const char * | szOutputFile, |
const char * | szInput, | ||
long | nPixelsPerModule, | ||
long | nPageWidth, | ||
long | nPageHeight, | ||
long | nX, | ||
long | nY, | ||
long | nOptions | ||
) |
Create a PDF file of a QR code.
[in] | szOutputFile | Name of output PDF file to be created. |
[in] | szInput | Text input to be encoded. |
[in] | nPixelsPerModule | Number of pixels per module (default = 2 ppm). |
[in] | nPageWidth | Width of PDF page in pixels (if zero then set width to fit QRcode image). |
[in] | nPageHeight | Height of PDF page in pixels (if zero then set height to fit QRcode image). |
[in] | nX | X-coordinate in pixels of bottom-left of QRcode image from origin at bottom-left of page. |
[in] | nY | Y-coordinate in pixels of bottom-left of QRcode image from origin at bottom-left of page. |
[in] | nOptions | Option flags. Select exactly one of: QRCODE_ECC_M (0) for error correction level M (default) QRCODE_ECC_L for error correction level L QRCODE_ECC_Q for error correction level Q QRCODE_ECC_H for error correction level H and optionally add: QRCODE_ESCAPED to indicate #-escaped sequences in the input string. |
nPageWidth
and nPageHeight
to change the size of the PDF page, and (nX
, nY
) to set the position of the QRcode image. OUT_OF_RANGE_ERROR
if QRcode image extends beyond page boundaries. long QRCODE_Version | ( | void | ) |
Get version number of the core DLL.
major*10000+minor*100+revision
, e.g. core DLL file version 1.2.x.3 will return 10203 long QRCODE_DllInfo | ( | char * | szOutput, |
long | nOutChars, | ||
long | nOptions | ||
) |
Get information about the core diQRcode DLL.
[out] | szOutput | Buffer to receive output string. |
[in] | nOutChars | Maximum length of output string in bytes. |
[in] | nOptions | For future use. |
Platform
is the platform the core DLL was compiled for: Win32
or X64
. long QRCODE_ErrorLookup | ( | char * | szOutput, |
long | nOutChars, | ||
long | nErrCode | ||
) |
Look up description for error code.
[out] | szOutput | Buffer to receive output string. |
[in] | nOutChars | Maximum length of output string in bytes. |
[in] | nErrCode | Value of error code to lookup (may be positive or negative). |