BSS QRCode Generator SDK (ver 2.2)
Description
SDK BSS QRCode Generator Win32 is a robust solution for generating QRCode barcodes. This SDK is Windows based. The document includes the description of software interface, the description of a package contents and instructions on how to build a sample project and examples of functions’ calls.
Structure of delivery
SDK BSS QRCode Generator Win32 is an archive which includes several components:
Components list
- Documentation (this document);
- Dynamic-linked libraries;
- Static library;
- Header file;
- Sample applications (console and GUI).
Description of Subdirectories
- include - Headers;
- examples - Sample applications;
- make - Project files of sample applications;
- doc – Documentation;
- lib – Import static library.
Activation
Trial version of the SDK can be used within 30 days on a standalone PC. During the first use (after 30 days trial period) of dynamic library from the delivery (for example when use a sample application) there will be a message with request to activate the copy of SDK. You will have to enter a License Key in the respective field. In order to receive it you will need to purchase the respective Commercial License at www.BarcodeSoftwareSolutions.com and send a System-ID and the version of used SDK to support@barcodesoftwaresolutions.com. Within 24 hours we will send the Commercial License Key.
Sample project
In order to compile a sample project you need to open .sln file which can be found in the “make” subdirectory. Select needed configuration to build (Release, Debug). Binary files will be created in the “bin” directory.
Projects’ configurations
SDK BSS QRCode Generator Win32 includes sample projects for Microsoft Visual Studio 8.0 IDE. There are two configurations in the delivery:
- Debug – Debug version of libraries, debug information is switched on, optimization is switched off;
- Release - optimization is switched on.
Program interface
The structure of SDK BSS QRCode Generator Win32 program interface is focused to provide developer with the easiest way to use SDK. There are only two plane C functions exported from dynamic library.
Functions
Function BSS_GenerateQRCode() generate a QRCode barcode.
BSS_DLL int BSS_GenerateQRCode
(
const char* pchData,
int nDataLength,
int nModSize,
int nImgRowMult,
void** ppImgData,
int* pnImgWidth,
int* pnImgHeight,
int* pnImgRowDist
);
- pchData – Barcode data for encoding
- nDataLength – Barcode data length
- nModSize – Barcode module size (in pixels)
- nImgRowMult – Desired row distance multiplier
- ppImgData – Pointer to image data pointer
- pnImgWidth – Pointer to image width
- pnImgHeight – Pointer to image height
- pnImgRowDist – Pointer to distance between image's rows
Return codes
- BSSG_QRCODE_OK - function was correctly completed.
- BSSG_QRCODE_ERR_GENERIC - Generic error code. The library doesn’t clarify or cannot determine what is happening.
- BSSG_QRCODE_ERR_OUTOFMEMORY - Ran out of memory. Some allocation failed.
- BSSG_QRCODE_ERR_NOTSUPPORTED - The feature requested is not supported.
- BSSG_QRCODE_ERR_INVALIDARGS - Argument validation failed.
- BSSG_QRCODE_ERR_OUTOFSYMBOLOGY - Cannot create the barcode symbol that would be contain this specified input data string by the reason of some bar code symbology limitation (one or more characters from input data string do not belong to symbology character set, input data string is too long, etc.)
Function BSS_ReleaseQRCodeResults() releases resources which were allocated for barcode image.
BSS_DLL int BSS_ReleaseQRCodeImage
(
void* pImgData,
int nImgWidth,
int nImgHeight,
int nImgRowDist
);
- pImgData – Pointer to barcode's image data
- nImgWidth - Image width
- nImgHeight – Image height
- nImgRowDist - Distance between image's rows (in bytes)
Return codes
- BSSG_QRCODE_OK - function was correctly completed.
- BSSG_QRCODE_ERR_INVALIDARGS - Argument validation failed.
Example
int iHeight = 0;
int iWidth = 0;
int iRowStride = 0;
void* pvImage = NULL;
int nRes = BSS_GenerateQRCode( ..., &pvImage, &iHeight, &iWidth, &iRowStride );
// TODO
// Releasing resources
BSS_ReleaseQRCodeImage( pvImage, iHeight, iWidth, iRowStride );