Konica Minolta Darwin VDP Software User Manual

Page 88

Advertising
background image



Page 88 of 92

T EC - I T B a r c o d e So f t w a re R e f e re n c e

B.9.4

Create a 2D Barcode Image with the Module Width specified in Pixels

To get a precise image you can adjust the size of the image in pixels according to the required
horizontal and vertical size of the barcode. By using the properties

2DXCols

(number of columns in

modules) and

2DXRows

(number of rows in modules) the size of the image can be optimized:

Dim nScale As Long
Dim nXSize As Long
Dim nYSize As Long

' 1) Initialize the barcode

TBarCode91.Text = "Somedata"
TBarCode91.BarCode = TBarCode9Lib.eBC_MicroPDF417

' 2) Use 5 pixels per module

nScale = 5
nXSize = TBarCode91.Get2DXCols * nScale

nYSize = TBarCode91.Get2DXRows * nScale

' 3) Save the barcode using the optimized size
' (Please note: The resolution specified by the last two parameters is only stored as
' information in the image attributes (if supported by the image type).
' It has no influence on the pixel size of the generated image.)

TBarCode91.SaveImage "C:/MyBarcode.bmp", TBarCode9Lib.eIMBmp, nXSize, nYSize, 72, 72

B.9.5

Optimize an Image using BCGetOptimalBitmapSize

The following code snippet shows you how to use the function

GetOptimalBitmapSize()

.

Dim lWidth As Long
Dim lHeight As Long

' 1) Initialize the barcode

TBarCode91.Text = "Somedata"
TBarCode91.BarCode = TBarCode9Lib.eBC_Code128
TBarCode91.Width = 200
TBarCode91.Height = 70

' 2) Optimize the pixel size of the barcode image

TBarCode91.GetOptimalBitmapSize 1, 1, lWidth, lHeight

' 3) Save the barcode using the optimized image width and height
' (Please note: The resolution specified by the last two parameters is only stored as
' information in the image attributes (if supported by the image type).
' It has no influence on the pixel size of the generated image.)

TBarCode91.SaveImage "C:\temp\Doc1.bmp", TBarCode9Lib.eIMBmp, lWidth, lHeight, 72, 72

Advertising