RQRCode is a Dephi Component that will allow you to create QRCode barcodes for your Delphi applications. The component can be used with any Delphi version starting with Delphi 4 (also tested with the most recent Delphi XE5) by simply recompiling the source code.
The QRCode following features are supported
In order to install from the Delphi source code (registered users only):
In the sample application you can set all properties of the Aztec code symbology.
You can execute the following commands:
- Refresh: repaint the symbol using the new properties.
- Print.
- Save BMP: save the symbol in bmp format.
The source code for the sample program can be found in the demoSrc subdirectory.
The TQRCode component has the following properties and methods:
Methods
- paintBarcode(canvas): paints the barcode on the provided canvas.
You can use the component in order to paint onto an external canvas. For example, in order to create a bitmap file you would use the following code:
var
bmp: TBitmap;
begin
bmp:=TBitmap.create();
bmp.height:=200;
bmp.width:=200;
{use paintBarcode() to paint onto an external Canvas}
barcode.paintBarcode(bmp.Canvas);bmp.saveToFile('barcode.bmp');
end;
Properties
- applicationIndicator. used only if FNC1 mode is SECOND .
- autoConfigurate: set it to true to select a larger barcode version (see preferredVersion) if the amount of data requires it.
- backColor: back color of the barcode.
- barColor: color of the bars.
- code: this is the value to be encoded.
- setCodeBinary(): value to be encoded (as TQRIntegerArray which is an array of Integer values).
- eci: extended channel interpretation identifier.
- correctionLevel: Four levels of error correction recovery are defined in QR Code:
- LEVEL_L = 0 ( 7 % )
- LEVEL_M = 1 ( 15 % )
- LEVEL_Q = 2 ( 25% )
- EVEL_H = 3 ( 30% )
- encoding: valid encoding algorithms are:
- ENC_ALPHA = 0: encodes alphanumeric characters (digits 0 - 9; upper case letters A -Z; nine other characters: space, $ % * + - . / : ); )
- ENC_BYTE = 1: encodes binary values ( 8-bit data)
- ENC_NUMERIC = 2: encodes numeric values only (digits 0-9)
- ENC_KANJI = 3: encodes Kanji characters. Kanji characters in QR Code can have values 8140 -9FFC and E040 - EBBF
- ENC_AUTO = 4: automatic seleccion of the encoding algorithm
- fnc1Mode:
- NO = 0 (default)
- FIRST = 1. This Mode Indicator identifies symbols encoding data formatted according to the UCC/EAN Application Identifiers standard.
- SECOND = 2. This Mode Indicator identifies symbols formatted in accordance with specific industry or application specifications previously agreed with AIM International. It is immediately followed by a one-byte codeword the value of which is that of the Application Indicator assigned to identify the specification concerned by AIM International.
- currentX (readonly): real size of the barcode. The value is set after the barcode is painted. Can be use to create an image of the exact size.
- currentY (readonly): real size of the barcode. Can be use to create an image of the exact size.
- PreferredVersion: Size (version) of the barcode , it can be any value between 1 and 40. If the autoconfigurate option is active a larger version will be automatically selected if the amount of data requires it. The symbol size can be 21 * 21 modules to 177 * 177 modules (Versions 1 to 40, increasing in steps of 4 modules per side).
- processTilde: process the " ~ " in the string to be encoded
~dNNN represents the ascii character encoded by the 3 digits NNN. For exmaple, ~d065 represents the character 'A'.
- margin: margin in pixels (default is 30).
- moduleWidth: size in pixels of the dots in the barcode
- structuredAppend: set it to true to enable the structured append mode.
- structuredAppendIndex: index of the barcode within the structured append sequence.
- structuredAppendTotal: number of symbols (barcodes) in the structured append sequence.