<< Click to Display Table of Contents >> VpeRenderDataMatrix |
[Professional Edition and above only]
Computes the dimensions of a DataMatrix barcode.
void VpeRenderDataMatrix(
VpeHandle hDoc,
LPCTSTR lpszText,
VpeCoord nWidth,
VpeCoord nHeight,
VpeCoord nModuleWidth
)
VpeHandle hDoc
Document Handle
LPCTSTR lpszText
the text of the barcode
VpeCoord nWidth, nHeight
With these two parameters you can specify a maximum size the barcode can have.
The following rules apply:
•nWidth and nHeight is specified: in this case the maximum rectangle of the barcode will be computed, which will fit into the given rectangle.
•Only nWidth is specified, nHeight is zero: In this case nHeight is computed (nWidth is also computed, i.e. adjusted).
•Only nHeight is specified, nWidth is zero: In this case nWidth is computed (nHeight is also computed, i.e. adjusted).
•nWidth and nHeight are zero: in this case the smallest possible rectangle is computed
VpeCoord nModuleWidth
If this parameter is zero, VPE will choose itself an optimum barcode module width. If it is non-zero, you can specify the width of a barcode module.
Example:
// Compute the smallest possible rectangle for a given text
VpeRenderDataMatrix(hDoc, "30Q324343430794<OQQ", 0, 0, 0)
xsize = VpeGet(hDoc, VRENDERWIDTH)
ysize = VpeGet(hDoc, VRENDERHEIGHT)
// Insert the barcode into the document
VpeDataMatrix(hDoc, 1, 1, -xsize, -ysize, "30Q324343430794<OQQ")
Remarks:
sets LastError
"Barcodes (2D)" in the Programmer's Manual