qualityapi.cpp File Reference


Functions

DOUBLE BCGetDPIHorz (t_BarCode* pBarCode)
 Gets current user-defined horizontal resolution. Gets current user-defined horizontal resolution.
See also:
BCSetDPI() \param[in] pBarCode Pointer to barcode structure.
Return values:
LONG   Horizontal DPI ----------------------------------------------------------------------------.


DOUBLE BCGetDPIVert (t_BarCode* pBarCode)
 Gets current user-defined vertical resolution. Gets current user-defined vertical resolution.
See also:
BCSetDPI() \param[in] pBarCode Pointer to barcode structure.
Return values:
LONG   Vertical DPI ----------------------------------------------------------------------------.


ERRCODE BCSetDPI (t_BarCode* pBarCode, DOUBLE dDPIHorz, DOUBLE dDPIVert)
 Sets user defined resolution. Sets output resolution to be used in bar code drawing / calculation functions. If not set (default), the resolution of the available device context is used (e.g. screen resolution or printer resolution). Can be used to estimate the quality of a bar code for a specific output resolution (BCGetQuality()). For other purposes this function should be used careful, because bar code dimensions can change unexpectedly.
See also:
BCGetDPIHorz(), BCGetDPIVert() \param[in] pBarCode Pointer to barcode structure. \param[in] dDPIHorz User defined horizontal DPI (-1 ... reset to default). \param[in] dDPIVert User defined vertical DPI (-1 ... reset to default) ==> Parameter is currently not used.
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.


BOOL BCGetMustFit (t_BarCode* pBarCode)
 Returns if the barcode must fit into the bounding rectangle. Returns currently adjusted value.
See also:
BCSetMustFit() \param[in] pBarCode Pointer to barcode structure.
Return values:
true   TBarCode checks if barcode fits into bounding rectangle
false   TBarCode does not check if barcode fits into bounding rectangle. This is the default ----------------------------------------------------------------------------.


ERRCODE BCSetMustFit (t_BarCode* pBarCode, BOOL bMustFit)
 Checks if the barcode fits into the bounding rectangle. This property means that the barcode must fit into the bounding rectangle during drawing. Background: When specifying a fixed module width the barcode width (not the width of the bounding rectangle) changes corresponding to the amount of data characters. In addition, "MustFit" verifies if the module width is less than 1 pixel (which is treated as error in this case) If "MustFit" is activated an error may be produced due to the above reasons during the BCDraw() method.
See also:
BCGetMustFit(), BCDraw() \param[in] pBarCode Pointer to barcode structure. \param[in] bMustFit - true: Check if barcode fits into bounding rectangle will be enabled - false: Check if barcode fits into bounding rectangle will be disabled (the default)
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.


BOOL BCGetOptResolution (t_BarCode* pBarCode)
 Gets current barcode optimizing behavior. Returns currently adjusted value.
See also:
BCSetOptResolution() \param[in] pBarCode Pointer to barcode structure.
Return values:
true   Optimization is enabled
false   Optimization is disabled. This is the default ----------------------------------------------------------------------------.


e_SizeMode BCGetSizeMode (const t_BarCode* pBarCode)
 Retrieves the mode that determines the barcode size. If operation fails, eSizeMode_Default (= -1) is returned. \param[in] pBarCode Pointer to barcode structure.
Returns:
Mode that describes how the barcode size is determined. ----------------------------------------------------------------------.


ERRCODE BCSetSizeMode (t_BarCode* pBarCode, e_SizeMode mode)
 Sets the mode that determines the barcode size. \param[in,out] pBarCode Pointer to barcode structure. \param[in] mode Mode that determines barcode size.
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------.


LPCSTR BCGetModWidthA (t_BarCode* pBarCode)
 Gets the current module width (value is returned as string). Returns currently adjusted value.
See also:
BCSetModWidth(), BCSetModWidthN()
Note:
This method converts the module width to a string [1/1000 mm]! \param[in] pBarCode Pointer to barcode structure.
Return values:
LPCSTR   String containing the module width [1/1000 mm] ----------------------------------------------------------------------------.


LPCWSTR BCGetModWidthW (t_BarCode* pBarCode)
 Gets the current module width (value is returned as string). Returns currently adjusted value.
See also:
BCSetModWidth(), BCSetModWidthN()
Note:
This method converts the module width to a string [1/1000 mm]! \param[in] pBarCode Pointer to barcode structure.
Return values:
LPCSTR   String containing the module width [1/1000 mm] ----------------------------------------------------------------------------.


ERRCODE BCSetModWidthA (t_BarCode* pBarCode, LPCSTR szModWidth)
 Sets a fixed module width (value is passed as string [0.001 mm]). The module width is defined as the width of the smallest element (bar or space) a barcode is using. Values are specified is 1/1000 mm. If the module width is not set explicitly (default), the module width is automatically adapted to the object size (Bounding rectangle) and the amount of data to be encoded. If a value is set, the width of the modules and therefore of the whole barcode can be controlled (this may also influence the readability!). If set, the barcode width depends on the amount of data encoded in the barcode. For most barcode symbologies the module width should not fall below 0.19 mm. When drawing (Paint) the size of the bounding rectangle must be wide enough to avoid clipping.
See also:
BCSetModWidthN()
Note:
This method expects that the required module width is converted into a string [1/1000 mm]! \param[in] pBarCode Pointer to barcode structure. \param[in] szModWidth Module width [1/1000 mm] (reset to default = "-1").
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.


ERRCODE BCSetModWidthW (t_BarCode* pBarCode, LPCWSTR szModWidth)
 Sets a fixed module width (value is passed as string [0.001 mm]). The module width is defined as the width of the smallest element (bar or space) a barcode is using. Values are specified is 1/1000 mm. If the module width is not set explicitly (default), the module width is automatically adapted to the object size (Bounding rectangle) and the amount of data to be encoded. If a value is set, the width of the modules and therefore of the whole barcode can be controlled (this may also influence the readability!). If set, the barcode width depends on the amount of data encoded in the barcode. For most barcode symbologies the module width should not fall below 0.19 mm. When drawing (Paint) the size of the bounding rectangle must be wide enough to avoid clipping.
See also:
BCSetModWidthN()
Note:
This method expects that the required module width is converted into a string [1/1000 mm]! \param[in] pBarCode Pointer to barcode structure. \param[in] szModWidth Module width [1/1000 mm] (reset to default = "-1").
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.


DOUBLE BCGetModWidthN (t_BarCode* pBarCode)
 Gets the module width. The value is returned as numeric parameter [0.001 mm].
See also:
BCSetModWidth() \param[in] pBarCode Pointer to barcode structure.
Returns:
Module width [1/1000 mm] (-1.0 = default). ----------------------------------------------------------------------------.


ERRCODE BCSetModWidthN (t_BarCode* pBarCode, DOUBLE moduleWidth)
 Sets a fixed module width (value is passed as numeric parameter [0.001 mm]). Sets a fixed module width passing a numeric value.
See also:
BCSetModWidth() \param[in] pBarCode Pointer to barcode structure. \param[in] moduleWidth Module width [1/1000 mm] (-1 ... reset to default).
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.


e_Decoder BCGetDecoder (t_BarCode* pBarCode)
 Returns the type of decoder that will be used to read this barcodes. The module width will be optimized for this type of scanner. \param[in] pBarCode Pointer to barcode structure.
Return values:
Type   of scanner. ----------------------------------------------------------------------.


ERRCODE BCSetDecoder (t_BarCode* pBarCode, e_Decoder eDecoder)
 Sets the type of decoder that will be used to read this barcodes. The module width will be optimized for this type of scanner. \param[in,out] pBarCode Pointer to barcode structure. \param[in] eDecoder Type of scanner.
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------.


DOUBLE BCGetBarWidthReduction (t_BarCode* pBarCode)
 Gets current bar-width reduction value. Returns currently adjusted value.
See also:
BCSetBarWidthReduction(), BCGetBarWidthReductionUnit() \param[in] pBarCode Pointer to barcode structure.
Return values:
LONG   Reduction in percent [0...100]. No reduction: 0 (this is the default) ----------------------------------------------------------------------------.


e_MUnit BCGetBarWidthReductionUnit (t_BarCode* pBarCode)
 Gets current bar-width reduction unit. Returns currently adjusted unit.
See also:
BCSetBarWidthReduction(), BCGetBarWidthReduction() \param[in] pBarCode Pointer to barcode structure.
Return values:
LONG   Reduction in percent [0...100]. No reduction: 0 (this is the default) ----------------------------------------------------------------------------.


ERRCODE BCSetBarWidthReduction (t_BarCode* pBarCode, DOUBLE dValue, e_MUnit eUnit)
 Sets bar-width reduction (Pixel-Shaving) in given unit. Specifies the reduction of the bar-widths. The width of a bar in the barcode is reduced by the given value in the given unit. This property is useful when you have to deal with dot gain in the printing process. Example: On inkjet printers the bars appear wider than specified because the ink spreads a little bit. Same with (high) toner saturation on laser printers. You can compensate this effect by setting a bar-width reduction (also called BWR or "Pixel Shaving") to a suitable value. You have to make tests to find optimal settings because the dot gain depends on the printing method and printing surface (paper). The printed module-width is equal to the theoretically optimal module-width reduced by the reduction value.

Note:
With a 2D matrix code, the BWR is applied horizontally and vertically to the modules (or matrix points). A single point or chain of points is reduced by 50% of the BWR on each side. By default connected modules (dots) are only reduced in their outer boundaries. With the 'DRAW_BarWidthReduction_Legacy' option you can specify how connected modules should be treated.
See also:
BCGetBarWidthReduction(), BCGetBarWidthReductionUnit(), BCSetOptions() \param[in] pBarCode Pointer to barcode structure. \param[in] dValue Reduction in given unit (0 ... reset to default ==> no reduction). \param[in] eUnit Reduction unit (valid values are: eMUMM, eMUMils, eMUInch, and eMUPercent).
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.


LONG BCGetQuality (t_BarCode* pBarCode, HDC hDC, RECT* pRect)
 Returns drawing quality estimate of the barcode (in percent) (Windows only). TBarCode computes the expected barcode quality depending on the used output resolution. This value is a measure for the bar width aberration created by the output resolution of the device context (and therefore of the device itself). The higher the quality value - the better.
Note:
WINDOWS only. \param[in] pBarCode Pointer to barcode structure. \param[in] hDC Device context handle of output device. \param[in] pRect IN : Bounding rectangle.
Return values:
LONG   Bar-code quality [0 (unreadable)...100 (perfect)] ----------------------------------------------------------------------------.


ERRCODE 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() \param[in] pBarCode Pointer to barcode structure. \param[in] bOpt Optimize barcode for resolution. - true: Optimization will be enabled - false: Optimization will be disabled (the default)
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.


BOOL BCGetIgnoreDpiFromDC (t_BarCode* pBarCode)
 Retrieves whether TBarCode ignores the resolution of the device context (Windows only). More...

ERRCODE BCSetIgnoreDpiFromDC (t_BarCode* pBarCode, BOOL bIgnore)
 Determines whether TBarCode shall ignore the resolution from the device context (Windows only). More...


Function Documentation

DOUBLE BCGetBarWidthReduction ( t_BarCode * pBarCode )

Gets current bar-width reduction value. Returns currently adjusted value.

See also:
BCSetBarWidthReduction(), BCGetBarWidthReductionUnit() \param[in] pBarCode Pointer to barcode structure.
Return values:
LONG   Reduction in percent [0...100]. No reduction: 0 (this is the default) ----------------------------------------------------------------------------.

e_MUnit BCGetBarWidthReductionUnit ( t_BarCode * pBarCode )

Gets current bar-width reduction unit. Returns currently adjusted unit.

See also:
BCSetBarWidthReduction(), BCGetBarWidthReduction() \param[in] pBarCode Pointer to barcode structure.
Return values:
LONG   Reduction in percent [0...100]. No reduction: 0 (this is the default) ----------------------------------------------------------------------------.

DOUBLE BCGetDPIHorz ( t_BarCode * pBarCode )

Gets current user-defined horizontal resolution. Gets current user-defined horizontal resolution.

See also:
BCSetDPI() \param[in] pBarCode Pointer to barcode structure.
Return values:
LONG   Horizontal DPI ----------------------------------------------------------------------------.

DOUBLE BCGetDPIVert ( t_BarCode * pBarCode )

Gets current user-defined vertical resolution. Gets current user-defined vertical resolution.

See also:
BCSetDPI() \param[in] pBarCode Pointer to barcode structure.
Return values:
LONG   Vertical DPI ----------------------------------------------------------------------------.

e_Decoder BCGetDecoder ( t_BarCode * pBarCode )

Returns the type of decoder that will be used to read this barcodes. The module width will be optimized for this type of scanner. \param[in] pBarCode Pointer to barcode structure.

Return values:
Type   of scanner. ----------------------------------------------------------------------.

BOOL BCGetIgnoreDpiFromDC ( t_BarCode * pBarCode )

Retrieves whether TBarCode ignores the resolution of the device context (Windows only).

\param[in,out] pBarCode Pointer to barcode structure.

Return values:
TRUE   TBarCode overwrites resolution from device context with custom resolution.
FALSE   TBarCode uses resolution of device context.
See also:
BCSetIgnoreDpiFromDC(), BCSetDPI()

LPCSTR BCGetModWidthA ( t_BarCode * pBarCode )

Gets the current module width (value is returned as string). Returns currently adjusted value.

See also:
BCSetModWidth(), BCSetModWidthN()
Note:
This method converts the module width to a string [1/1000 mm]! \param[in] pBarCode Pointer to barcode structure.
Return values:
LPCSTR   String containing the module width [1/1000 mm] ----------------------------------------------------------------------------.

DOUBLE BCGetModWidthN ( t_BarCode * pBarCode )

Gets the module width. The value is returned as numeric parameter [0.001 mm].

See also:
BCSetModWidth() \param[in] pBarCode Pointer to barcode structure.
Returns:
Module width [1/1000 mm] (-1.0 = default). ----------------------------------------------------------------------------.

LPCWSTR BCGetModWidthW ( t_BarCode * pBarCode )

Gets the current module width (value is returned as string). Returns currently adjusted value.

See also:
BCSetModWidth(), BCSetModWidthN()
Note:
This method converts the module width to a string [1/1000 mm]! \param[in] pBarCode Pointer to barcode structure.
Return values:
LPCSTR   String containing the module width [1/1000 mm] ----------------------------------------------------------------------------.

BOOL BCGetMustFit ( t_BarCode * pBarCode )

Returns if the barcode must fit into the bounding rectangle. Returns currently adjusted value.

See also:
BCSetMustFit() \param[in] pBarCode Pointer to barcode structure.
Return values:
true   TBarCode checks if barcode fits into bounding rectangle
false   TBarCode does not check if barcode fits into bounding rectangle. This is the default ----------------------------------------------------------------------------.

BOOL BCGetOptResolution ( t_BarCode * pBarCode )

Gets current barcode optimizing behavior. Returns currently adjusted value.

See also:
BCSetOptResolution() \param[in] pBarCode Pointer to barcode structure.
Return values:
true   Optimization is enabled
false   Optimization is disabled. This is the default ----------------------------------------------------------------------------.

LONG BCGetQuality ( t_BarCode * pBarCode,
HDC hDC,
RECT * pRect )

Returns drawing quality estimate of the barcode (in percent) (Windows only). TBarCode computes the expected barcode quality depending on the used output resolution. This value is a measure for the bar width aberration created by the output resolution of the device context (and therefore of the device itself). The higher the quality value - the better.

Note:
WINDOWS only. \param[in] pBarCode Pointer to barcode structure. \param[in] hDC Device context handle of output device. \param[in] pRect IN : Bounding rectangle.
Return values:
LONG   Bar-code quality [0 (unreadable)...100 (perfect)] ----------------------------------------------------------------------------.

e_SizeMode BCGetSizeMode ( const t_BarCode * pBarCode )

Retrieves the mode that determines the barcode size. If operation fails, eSizeMode_Default (= -1) is returned. \param[in] pBarCode Pointer to barcode structure.

Returns:
Mode that describes how the barcode size is determined. ----------------------------------------------------------------------.

ERRCODE BCSetBarWidthReduction ( t_BarCode * pBarCode,
DOUBLE dValue,
e_MUnit eUnit )

Sets bar-width reduction (Pixel-Shaving) in given unit. Specifies the reduction of the bar-widths. The width of a bar in the barcode is reduced by the given value in the given unit. This property is useful when you have to deal with dot gain in the printing process. Example: On inkjet printers the bars appear wider than specified because the ink spreads a little bit. Same with (high) toner saturation on laser printers. You can compensate this effect by setting a bar-width reduction (also called BWR or "Pixel Shaving") to a suitable value. You have to make tests to find optimal settings because the dot gain depends on the printing method and printing surface (paper). The printed module-width is equal to the theoretically optimal module-width reduced by the reduction value.

Note:
With a 2D matrix code, the BWR is applied horizontally and vertically to the modules (or matrix points). A single point or chain of points is reduced by 50% of the BWR on each side. By default connected modules (dots) are only reduced in their outer boundaries. With the 'DRAW_BarWidthReduction_Legacy' option you can specify how connected modules should be treated.
See also:
BCGetBarWidthReduction(), BCGetBarWidthReductionUnit(), BCSetOptions() \param[in] pBarCode Pointer to barcode structure. \param[in] dValue Reduction in given unit (0 ... reset to default ==> no reduction). \param[in] eUnit Reduction unit (valid values are: eMUMM, eMUMils, eMUInch, and eMUPercent).
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.

ERRCODE BCSetDPI ( t_BarCode * pBarCode,
DOUBLE dDPIHorz,
DOUBLE dDPIVert )

Sets user defined resolution. Sets output resolution to be used in bar code drawing / calculation functions. If not set (default), the resolution of the available device context is used (e.g. screen resolution or printer resolution). Can be used to estimate the quality of a bar code for a specific output resolution (BCGetQuality()). For other purposes this function should be used careful, because bar code dimensions can change unexpectedly.

See also:
BCGetDPIHorz(), BCGetDPIVert() \param[in] pBarCode Pointer to barcode structure. \param[in] dDPIHorz User defined horizontal DPI (-1 ... reset to default). \param[in] dDPIVert User defined vertical DPI (-1 ... reset to default) ==> Parameter is currently not used.
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.

ERRCODE BCSetDecoder ( t_BarCode * pBarCode,
e_Decoder eDecoder )

Sets the type of decoder that will be used to read this barcodes. The module width will be optimized for this type of scanner. \param[in,out] pBarCode Pointer to barcode structure. \param[in] eDecoder Type of scanner.

Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------.

ERRCODE BCSetIgnoreDpiFromDC ( t_BarCode * pBarCode,
BOOL bIgnore )

Determines whether TBarCode shall ignore the resolution from the device context (Windows only).

In some (rare) cases the Windows GDI device context does not contain a valid resolution. In such cases you can overwrite the resolution of the device context with a custom resolution. Use BCSetDPI() to set the custom resolution.

Note:
This flag is only relevant for Windows GDI drawing routines.

\param[in,out] pBarCode Pointer to barcode structure. \param[in,out] bIgnore TRUE: Overwrite resolution of device with custom resolution.
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred.
See also:
BCGetIgnoreDpiFromDC(), BCSetDPI()

ERRCODE BCSetModWidthA ( t_BarCode * pBarCode,
LPCSTR szModWidth )

Sets a fixed module width (value is passed as string [0.001 mm]). The module width is defined as the width of the smallest element (bar or space) a barcode is using. Values are specified is 1/1000 mm. If the module width is not set explicitly (default), the module width is automatically adapted to the object size (Bounding rectangle) and the amount of data to be encoded. If a value is set, the width of the modules and therefore of the whole barcode can be controlled (this may also influence the readability!). If set, the barcode width depends on the amount of data encoded in the barcode. For most barcode symbologies the module width should not fall below 0.19 mm. When drawing (Paint) the size of the bounding rectangle must be wide enough to avoid clipping.

See also:
BCSetModWidthN()
Note:
This method expects that the required module width is converted into a string [1/1000 mm]! \param[in] pBarCode Pointer to barcode structure. \param[in] szModWidth Module width [1/1000 mm] (reset to default = "-1").
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.

ERRCODE BCSetModWidthN ( t_BarCode * pBarCode,
DOUBLE moduleWidth )

Sets a fixed module width (value is passed as numeric parameter [0.001 mm]). Sets a fixed module width passing a numeric value.

See also:
BCSetModWidth() \param[in] pBarCode Pointer to barcode structure. \param[in] moduleWidth Module width [1/1000 mm] (-1 ... reset to default).
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.

ERRCODE BCSetModWidthW ( t_BarCode * pBarCode,
LPCWSTR szModWidth )

Sets a fixed module width (value is passed as string [0.001 mm]). The module width is defined as the width of the smallest element (bar or space) a barcode is using. Values are specified is 1/1000 mm. If the module width is not set explicitly (default), the module width is automatically adapted to the object size (Bounding rectangle) and the amount of data to be encoded. If a value is set, the width of the modules and therefore of the whole barcode can be controlled (this may also influence the readability!). If set, the barcode width depends on the amount of data encoded in the barcode. For most barcode symbologies the module width should not fall below 0.19 mm. When drawing (Paint) the size of the bounding rectangle must be wide enough to avoid clipping.

See also:
BCSetModWidthN()
Note:
This method expects that the required module width is converted into a string [1/1000 mm]! \param[in] pBarCode Pointer to barcode structure. \param[in] szModWidth Module width [1/1000 mm] (reset to default = "-1").
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.

ERRCODE BCSetMustFit ( t_BarCode * pBarCode,
BOOL bMustFit )

Checks if the barcode fits into the bounding rectangle. This property means that the barcode must fit into the bounding rectangle during drawing. Background: When specifying a fixed module width the barcode width (not the width of the bounding rectangle) changes corresponding to the amount of data characters. In addition, "MustFit" verifies if the module width is less than 1 pixel (which is treated as error in this case) If "MustFit" is activated an error may be produced due to the above reasons during the BCDraw() method.

See also:
BCGetMustFit(), BCDraw() \param[in] pBarCode Pointer to barcode structure. \param[in] bMustFit - true: Check if barcode fits into bounding rectangle will be enabled - false: Check if barcode fits into bounding rectangle will be disabled (the default)
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.

ERRCODE 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() \param[in] pBarCode Pointer to barcode structure. \param[in] bOpt Optimize barcode for resolution. - true: Optimization will be enabled - false: Optimization will be disabled (the default)
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.

ERRCODE BCSetSizeMode ( t_BarCode * pBarCode,
e_SizeMode mode )

Sets the mode that determines the barcode size. \param[in,out] pBarCode Pointer to barcode structure. \param[in] mode Mode that determines barcode size.

Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------.


© 2019 All rights reserved by TEC-IT Datenverarbeitung GmbH
Generated on Sat Jul 13 03:16:06 2019 for TBarCode Library 11 with doxygen 1.1.5