TBarCode Library 11  TBarCode Library 11
ERRCODE _stdcall BCSetOptResolution ( t_BarCode pBarCode,
BOOL  bOpt 
)

Optimize barcode resolution.

If this feature is activated, the module width will be adapted to the resolution of the output device (or output format) by TBarCode. All bars/spaces of a barcode are aligned to the output raster in a way that only full pixels for the bar (space) widths are used. This process depends either on the DPI in the drawing DC (screen or printer driver) or the DPI property in the TBarCode Library. Using optimization the readability of the barcode is (quite) independent from the given resolution (except the resulting bar code will be too small). Using this option is recommended for bitmap formats or low output resolutions (e.g. screen or thermal transfer printers).

Note:
The total width of the barcode may shrink compared to the non-optimized version. With eSizeMode_FitToBoundingRect the resulting barcode will not be larger than the bounding-rectangle. Keep care about the minimal size of the barcode!
If you use this feature with a custom module width, add a tolerance of 0.001 mm to the module width.
Hint for saving the barcode in Postscript/EPS format: If the DPI is not explicitly set in the library, the module width will be adapted to the default EPS 72 dpi raster width. That means the module width becomes a multiple of 1/72" (point). This may be relevant if you convert the EPS output to a raster / bitmap image format in a second step.
See also:
BCGetOptResolution() BCSetDPI()
Parameters:
[in]pBarCodePointer to barcode structure.
[in]bOptOptimize barcode for resolution.
  • true: Optimization will be enabled
  • false: Optimization will be disabled (the default)
Return values:
ERRCODEErrOk (0) in case of success. Non-zero if error occurred.