Table of Contents
Many programming environments support the use of ActiveX objects. We have tested the Morovia DataMatrix ActiveX Control 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 DataMatrix ActiveX object can also be inserted into Microsoft Office documents and many other ActiveX-aware programs.
Table 5.1. DataMatrix Control Specification
Prog ID | Morovia.DataMatrixControl |
---|---|
ClassID | {16192DED-A048-4136-94C0-2BE735582AD1} |
Licensed | no |
File name | DataMatrixCtrl.dll |
Interface | IDataMatrixCtrlObj |
Interface ID | {680D55CA-980E-4559-89A7-F96CA595CE6A} |
Table 5.2. List of DataMatrix Control Properties
Name | Description |
---|---|
BackColor | Specifies the background color for the control. |
ForeColor | Specifies the foreground color for the control. |
ModuleWidth | Specifies the width of a module (the smallest unit in a DataMatrix barcode). |
Picture | Returns a snapshot of the drawing in Windows Enhanced Metafile Format (EMF). |
SizeID | Returns or sets a value for size ID of the data matrix symbols generated. |
TargetDPI | Specifies the value of DPI when exporting the images to vector graphics. |
Text | Specifies the data to encode. |
Table 5.3. List of DataMatrix Control Methods
Name | Description |
---|---|
CopyToClipboard | Place the drawing to clipboard in EMF format. |
GetActualSizeID | Retrieves the actual size of the datamatrix symbol generated. |
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
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.
Description
Returns or sets a value that determines the width of a single module in the data matrix symbols generated.
Syntax
object.ModuleWidth[= String]
Remarks
The “real estate” unit of a DataMatrix symbol, the module, is always rectangular. This property sets the width of the rectangle. 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 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 VB6, VC++ and C# examples use this property to retrieve an EMF handle and play it on the target printer to print the barcode.
Description
Gets and Sets the size ID desired.
Syntax
object.SizeID
Remarks
Use this property to pass the datamatrix size desired, and the modifier byte that specifies additional encoder parameters. See Appendix C, Size ID Parameter (updated in version 5.1) for more information.
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 DataMatrix symbol.
Description
Returns or sets a string for the message to be encoded.
Syntax
object.Text[= String]
Remarks
Copies the DataMatrix 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, pixelsPerModule, imageType)
Parameters
- filename
[in] filename. A string that corresponds to the file to be written.
- pixelsPerModule
[in] Number of pixels per module.
- imageType
[in] Image type. The current version supports two raster image formats:
0 - PNG
4 - BMP
Description
Exports the current drawing to a disk file, in raster image format (EMF, SVG and EPS).
Syntax
obj.ExportImageVector(filename, imageType)
Parameters
- filename
[in] filename. A string that corresponds to the file to be written.
- imageType
[in] Image type. The current version supports two three image formats:
1 - SVG
2 - EMF
3 - EPS