Table of Contents
- 9.1. Specification
- 9.2. Enumerations
- 9.3. Properties
- 9.4. ActualVersion Property
- 9.5. BackColor, ForeColor Properties
- 9.6. ECLevel Property
- 9.7. Mask Property
- 9.8. ModuleSize Property
- 9.9. Picture Property
- 9.10. QRType Enumeration
- 9.11. QRType Property
- 9.12. TargetDPI Property
- 9.13. Text Property
- 9.14. Version Property
- 9.15. CopyToClipboard Method
- 9.16. ExportImageRaster Method
- 9.17. ExportImageVector Method
Many programming environments support the use of ActiveX objects. We have tested the Morovia QRCode ActiveX with Visual Basic, Visual C++, Internet Explorer, Microsoft Word, Excel, Access and IIS programs. The object can be used as a control embedded in a VB form or a dialog, or be used at background for image creation and printing purposes. The QR Code ActiveX object can also be inserted into Microsoft Office documents and many other ActiveX-aware programs.
Table 9.1. QRCode ActiveX Specification
Prog ID | Morovia.QRCodeActiveX |
ClassID | {13C6D4E9-81BF-4BC6-B90E-B405CC3C0DC2} |
Licensed | no |
File name | QRCodeCtrl.dll |
Interface | IQRCodeActiveX |
Interface ID | {5AF858A3-0D3E-4D8E-B22F-F8191C60C161} |
Table 9.3. List of QRCode ActiveX Properties
Name | Description |
---|---|
ActualVersion | Returns the actual version in the symbol created. |
BackColor | Specifies the background color for the control. |
ECLevel | Specifies the error correction level of the barcode generated. |
ForeColor | Specifies the foreground color for the control. |
Mask | Specifies the mask used to create final image. |
ModuleSize | Specifies the length of a module (the smallest unit in a QRCode barcode). |
Picture | Returns a snapshot of the drawing in Windows Enhanced Metafile Format (EMF). |
QRType | Specifies the type of QR code to create. |
TargetDPI | Specifies the value of DPI when exporting the images to vector graphics. |
Text | Specified the data to encode. |
Version | Specifies the desired version (size) of the barcode. |
Table 9.4. List of QRCode ActiveX Methods
Name | Description |
---|---|
CopyToClipboard | Place the drawing to clipboard in EMF format. |
ExportImageVector | Export image to a file in vector graphics format specified (EMF, EPS or SVG). |
ExportImageRaster | Export image to a file in raster graphics fromat specified (PNG or BMP). |
Description
Returns the actual version of the symbol created.
Syntax
object.ActualVersion
Remarks
When Version
specified is too small to encode the data,
the program automatically select one that creates smallest barcode that
fits. To find out the value of version realized, use this property.
Description
BackColor - returns or sets the background color of the control.
ForeColor - returns or sets the foreground color of the control.
Syntax
object.BackColor[= Color] object.ForeColor[= Color]
Remarks
For open systems we strongly recommend to set the background color
to solid white (0xFFFFFF
) and foreground color to
black (0x000000
). Note: barcode requires decent contrast
between the foreground color and the background color in
order to be readable. Always test the readability thoroughly when you
select a color pair different from black and white.
Specifies the error correction level.
Syntax
object.ECLevel = Number
Description
QR Code employs Reed-Solomon error control coding to detect and repair errors. There are four user-selectable levels of error correction, as shown in the table below.
Table 9.5. ECLevel options
Value | Description | Recovery Capacity (approx.) |
---|---|---|
0 | Level L | 7% |
1 | Level M | 15% |
2 | Level Q | 25% |
3 | Level H | 30% |
Specifies the pattern to be used for data masking.
Syntax
object.Mask[= Number]
Description
For reliable QR Code reading, it is desirable for dark and light modules to be arranged in a well-balanced manner in the symbol. QR standard allows 7 patterns (000 - 111) to be used for data masking. If the value is -1, this program evaluates all seven patterns and select the one that produces the best result.
Table 9.6. Mask options
Value | Description |
---|---|
-1 | Auto |
0 | pattern 0 (000) |
1 | pattern 1 (001) |
2 | pattern 2 (010) |
3 | pattern 3 (011) |
4 | pattern 4 (100) |
5 | pattern 5 (101) |
6 | pattern 6 (110) |
7 | pattern 7 (111) |
Description
Returns or sets a value that determines the width and height of a single cell in the QRcode symbols generated.
Syntax
object.ModuleSize[= String]
Remarks
The “real estate” unit of a QR Code symbol, the module, is always square. This property sets both the width and the height of the square. It affects the overall symbol size.
The default value for ModuleSize is 20
mils. The property can be any numbers between 1
and 100
.
This property is a string, and accepts the following units: mil, himetric, mm, cm, pt and inch. For example, “0.01cm” and “1mm” are all valid. If no measure unit is specified, unit of mil (which is 1/1000th inch) is assumed.
Description
Readonly property. Returns a snapshot of the drawing in Windows Enhanced Metafile Format (EMF).
Syntax
object.Picture
Remarks
The Picture property provides a convenient method to retrieve the drawing without first saving it to disk. The picture object contains an enhanced metafile handle which can be passed to clipboard or played on a device.
The included VC++ and C# examples use this property to retrieve an EMF handle and play it on the target printer to print the barcode.
Specifies the type of the QRCode.
Syntax
typedef enum QRType { qrNormal = 0, qrHIBC = 1, } QRType;
Constants
- qrNormal
- The normal QR Code.
- qrHIBC
The data to encode is a HIBC LIC. The program will adds + and mod 43 checksum automatically and encode the whole into a QRCode.
- qrMicro
- The Micro QR Code.
Specifies the type of QR code. Currently it suports two types of QR Code symbols - normal QR and HIBC QR.
Syntax
object.QRType = Number
Remarks
The defautl value of this property is QRNormal
.
Specifies the resolution of the target printer, applicable during exporting vector graphics.
Syntax
object.TargetDPI = Number
Remarks
Whe producing small sizes of barcodes, especailly on lowe resolution printers, lengths must be align to the boundary of pixels in order to retain high quality. The ActiveX control adjusts the drawing units automaticaly based on this property when exporting vector graphics images.
Specifies the Data to be encoded into the QR Code symbol.
Description
Returns or sets a string for the message to be encoded.
Syntax
object.Text[= String]
Remarks
Specifies the version of the symbol. The value ranges from 0 to 40. if the value is 0, the program select one that encodes the data and with minimum size.
Syntax
object.Version = Number
Description
There are forty sizes of QR Code symbol rerferred to as version 1, Version 2 ... Version 40. Version 1 measures 21 modules x 21 modules, Version 2 measures 25 modules x 25 modules and so on increasing in steps of 4 modules per side up to version 40 which measures 177 modules x 177 modules.
When 0 is specified, the program selects a size that produces the most compact barcode that encodes the data.
Warning
If Version
specified is too small to encode the data,
the program automatically increase it to a value that is big enough. It means
that the value of property will change every time the data is changed, if
it is set to 0. Therefore, you must explicitely set it back to 0 you intend
to use this value for creating the next QR code symbol.
Copies the QRCode image into the system clipboard, in EMF format.
Syntax
obj.CopyToClipboard
Description
Use this method to place a copy of barcode image to the clipboard, so that you can either retrieve it immediately in your application, or other applications such as Microsoft Word.
Description
Exports the current drawing to a disk file, in raster image format (PNG or BMP).
Syntax
obj.ExportImageRaster(filename, Number, Number)
Parameters
- pixelsPerModule
[in] Number of pixels per module.
- imageType
[in] Image type. The current version supports two raster image formats:
0 - PNG
4 - BMP