sizeapi.cpp File Reference


Functions

DOUBLE BCGet2D_XRows (const t_BarCode* pBarCode)
 Returns the height of the barcode in modules. The measurement unit used for the return value is the module width (X). The total symbol height would be the return value of this function * X (X = module width) + height of text area (BCGetTextAreaHeight()). Can be used for BCSaveImage() to optimize the resolution of the resulting image.
Note:
To be used with 2D symbologies and all composite codes (with a 2D composite component). Please contact support@tec-it.com if you have to deal with resolution (bitmap) issues.
See also:
BCGet2D_XCols(), BCGetTextAreaHeight() \param[in] pBarCode Pointer to barcode structure.
Return values:
LONG   Number of vertical modules ----------------------------------------------------------------------------.


LONG BCGet2D_XCols (const t_BarCode* pBarCode)
 Returns the width of the barcode in modules. The measurement unit used for the return value is the module width (X). The total symbol width would be the return value of this function * X (X = module width). Can be used for BCSaveImage() to optimize the resolution of the resulting image.
Note:
To be used with 2D symbologies and all composite codes (with a 2D composite component).
See also:
BCGet2D_XRows(), BCGetTextAreaHeight() \param[in] pBarCode Pointer to barcode structure.
Return values:
LONG   Number of horizontal modules ----------------------------------------------------------------------------.


DOUBLE BCGetCountModules (const t_BarCode* pBarCode)
 Returns the number of modules in the barcode. Returns the number of modules for the current barcode with respect to encoded data, check-digits, subset and other barcode parameters. With 2D symbologies the total number of all modules (in all rows) will be returned.
Note:
To be used with linear symbologies.
Call this function after BCCreate()
See also:
BCGet2D_XCols()
Returns:
Number of modules ----------------------------------------------------------------------------.


LONG BCGetCountRows (const t_BarCode* pBarCode)
 Returns the number of rows in the barcode. Returns the number of rows in multi-row symbologies (PDF417, Data Matrix, Codablock-F, QR-Code, MicroPDF417, RSS Stacked versions)
Note:
To be used with the following symbologies: PDF417, Data Matrix, Codablock-F, QR-Code, MicroPDF417
Call this function after BCCreate()
See also:
BCGet2D_XRows() \param[in] pBarCode Pointer to barcode structure.
Return values:
LONG   Number of rows ----------------------------------------------------------------------------.


DOUBLE BCGetModuleWidth (t_BarCode* pBarCode, LPRECT pRect, HDC hDC, e_MUnit eUnit)
 Returns the module width. Returns the computed module width for a given device context with respect to encoded data, check-digits, subset and other barcode parameters. You can specify the unit, which should be used for the return value.
hDC can be NULL. In this case the bounding rectangle must be specified in 1/1000 mm. The measurement units are: - eMUDefault ... logical units of the given device context. - eMUMM ... millimeters - eMUPixel ... pixels if device context is given, otherwise points (= 1/72 inch)
Note:
Call this function after BCCreate() \param[in] pBarCode Pointer to barcode structure. \param[in] pRect Bounding rectangle. \param[in] hDC Device context handle. \param[in] eUnit Measurement unit.
Return values:
LONG   Module width ----------------------------------------------------------------------------.


DOUBLE BCGetBarcodeWidth (t_BarCode* pBarCode, LPRECT pRect, HDC hDC, e_MUnit eUnit)
 Returns the total width of the barcode symbol. Returns the total barcode width in the specified measurement unit for a given device context. You can specify the measurement unit, which should be used for the return value. Use BCGetBarcodeSize() if you also need the height of the symbol. As for the bounding rectangle pass in the same coordinates as you would use for drawing. Some symbologies have a specific width/height ratio and therefore the bar code size is adapted to fit into the bounding rectangle. If a module width has been set, the bar code width depends on the module width and the number of horizontal modules.
hDC can be NULL. In this case the bounding rectangle must be specified in 1/1000 mm. The measurement units are: - eMUDefault ... logical units of the given device context. - eMUMM ... millimeters - eMUPixel ... pixels if device context is given, otherwise points (= 1/72 inch)
See also:
BCGetBarcodeHeight(), BCGetBarcodeSize(), BCSetModWidth()
Note:
Call this function after BCCreate(). Please take care of rotation if you use the result of this function to calculate the bounding rectangle for drawing. If you use a rotation of 90° or 270° the width is calculated from rect.top and rect.bottom and the height from rect.left and rect.right (return values depend on size mode and module width settings). \param[in] pBarCode Pointer to barcode structure. \param[in] pRect Bounding rectangle. \param[in] hDC Device context handle. \param[in] eUnit Measurement unit.
Return values:
LONG   Width of barcode symbol ----------------------------------------------------------------------------.


DOUBLE BCGetBarcodeHeight (t_BarCode* pBarCode, LPRECT pRect, HDC hDC, e_MUnit eUnit)
 Returns the height of the barcode symbol. Returns the total barcode height in the specified measurement unit. Use BCGetBarcodeSize() if you also need the width of the symbol. As for the bounding rectangle pass in the same coordinates as you would use for drawing. Some symbologies have a specific width/height ratio and therefore the bar code size is adapted to fit into the bounding rectangle.
Relevant for 2D or Multi-Row Symbologies (e.g. PDF417, Data Matrix, RSS Stacked...): If a row height has been set, the bar code height depends on the adjusted row height and the number of rows in the symbol. For some symbologies also the module width is relevant for the symbol height.
hDC can be NULL. In this case the bounding rectangle must be specified in 1/1000 mm. The measurement units are: - eMUDefault ... logical units of the given device context. - eMUMM ... millimeters - eMUPixel ... pixels if device context is given, otherwise points (= 1/72 inch)
See also:
BCGetBarcodeSize(), BCGetBarcodeWidth(), BCSetModWidth(), BCSet_PDF417_RowHeight()
Note:
Call this function after BCCreate(). Please take care of rotation if you use the result of this function to calculate the bounding rectangle for drawing. If you use a rotation of 90° or 270° the width is calculated from rect.top and rect.bottom and the height from rect.left and rect.right (return values depend on size mode and module width settings). \param[in] pBarCode Pointer to barcode structure. \param[in] pRect Bounding rectangle. \param[in] hDC Device context handle. \param[in] eUnit Measurement unit.
Return values:
LONG   Height of barcode symbol ----------------------------------------------------------------------------.


ERRCODE BCGetBarcodeSize (t_BarCode* pBarCode, LPRECT pRect, HDC hDC, e_MUnit eUnit, DOUBLE* pdWidth, DOUBLE* pdHeight)
 Computes the barcode size (recommended method). Computes width and height of barcode with one call. You can use this function before you draw the barcode to ensure that there is enough space available. Call this function after BCCreate() and specify a bounding rectangle (target coordinates, where you would draw the barcode). This rectangle is relevant if you haven't specified a module width or a row height. As for the bounding rectangle pass in the same coordinates as you would use for drawing. Some symbologies have a specific width/height ratio and therefore the bar code size is adapted to fit into the bounding rectangle.
hDC can be NULL. In this case the bounding rectangle must be specified in 1/1000 mm. The measurement units are: - eMUDefault ... logical units of the given device context. - eMUMM ... millimeters - eMUPixel ... pixels if device context is given, otherwise points (= 1/72 inch)
See also:
BCGetBarcodeHeight(), BCGetBarcodeWidth()
Note:
Call this function after BCCreate(). Please take care of rotation if you use the result of this function to calculate the bounding rectangle for drawing. With a rotation of 90° or 270° the width is calculated from rect.top and rect.bottom and the height from rect.left and rect.right (return values depend on size mode and module width settings). \param[in] pBarCode Pointer to barcode structure. \param[in] pRect Bounding rectangle. \param[in] hDC Device context handle. \param[in] eUnit Measurement unit. \param[in, out] pdWidth Pointer to resulting width (NULL if not required). \param[in, out] pdHeight Pointer to resulting height (NULL if not required).
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.


DOUBLE BCGetTextAreaHeight (t_BarCode* pBarCode, LPRECT pRect, HDC hDC, e_MUnit eUnit)
 Returns the height of the human readable text area. Returns the height of the human readable text area in the specified measurement unit.
hDC can be NULL. In this case the bounding rectangle must be specified in 1/1000 mm. The measurement units are: - eMUDefault ... logical units of the given device context. - eMUMM ... millimeters - eMUPixel ... pixels if device context is given, otherwise points (= 1/72 inch) \param[in] pBarCode Pointer to barcode structure. \param[in] pRect Bounding rectangle. \param[in] hDC Device context handle. \param[in] eUnit Measurement unit.
Return values:
0   If no text-area used for barcode.
>0   Height of text-area in the specified measurement units. ----------------------------------------------------------------------------.


ERRCODE BCGetOptimalBitmapSize (t_BarCode* pBarCode, LPRECT pRect, LONG nScaleX, LONG nScaleY)
 Returns the optimal size of a bitmap for given bar code settings. The optimal bitmap size depends on the number of horizontal bar/space modules and also on the number of vertical rows (multi-row or matrix codes). The default height for linear codes can be preset by the pRect->bottom parameter. This function also takes the DPI property into account. You can use the returned values as input for the save image functions.
Note:
This function calculates the bar code size for a rotation of 0 degrees.
If a quiet zone is set, it is considered automatically by GetOptimalBitmapSize. But note that only quiet zones given in modules or pixels can be handled. The other units lead to an error because a device context would be needed for a proper bitmap size calculation. If you apply the results for a rotated bar code of 90° or 270° you have to exchange width and height.
See also:
BCSetDPI(), BCSaveImage(), BCSaveImageToBuffer(), BCBitmapToFile(), BCBitmapToMemory() \param[in] pBarCode Pointer to barcode structure. \param[in, out] pRect [in] The size of the bounding rectangle without HRT (for barcode orientation of 0 degrees) in Pixels. [out] The size of the optimal bitmap including HRT (if any) in Pixels. \param[in] nScaleX Horizontal scaling factor. \param[in] nScaleY Vertical scaling factor.
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.



Function Documentation

LONG BCGet2D_XCols ( const t_BarCode * pBarCode )

Returns the width of the barcode in modules. The measurement unit used for the return value is the module width (X). The total symbol width would be the return value of this function * X (X = module width). Can be used for BCSaveImage() to optimize the resolution of the resulting image.

Note:
To be used with 2D symbologies and all composite codes (with a 2D composite component).
See also:
BCGet2D_XRows(), BCGetTextAreaHeight() \param[in] pBarCode Pointer to barcode structure.
Return values:
LONG   Number of horizontal modules ----------------------------------------------------------------------------.

DOUBLE BCGet2D_XRows ( const t_BarCode * pBarCode )

Returns the height of the barcode in modules. The measurement unit used for the return value is the module width (X). The total symbol height would be the return value of this function * X (X = module width) + height of text area (BCGetTextAreaHeight()). Can be used for BCSaveImage() to optimize the resolution of the resulting image.

Note:
To be used with 2D symbologies and all composite codes (with a 2D composite component). Please contact support@tec-it.com if you have to deal with resolution (bitmap) issues.
See also:
BCGet2D_XCols(), BCGetTextAreaHeight() \param[in] pBarCode Pointer to barcode structure.
Return values:
LONG   Number of vertical modules ----------------------------------------------------------------------------.

DOUBLE BCGetBarcodeHeight ( t_BarCode * pBarCode,
LPRECT pRect,
HDC hDC,
e_MUnit eUnit )

Returns the height of the barcode symbol. Returns the total barcode height in the specified measurement unit. Use BCGetBarcodeSize() if you also need the width of the symbol. As for the bounding rectangle pass in the same coordinates as you would use for drawing. Some symbologies have a specific width/height ratio and therefore the bar code size is adapted to fit into the bounding rectangle.
Relevant for 2D or Multi-Row Symbologies (e.g. PDF417, Data Matrix, RSS Stacked...): If a row height has been set, the bar code height depends on the adjusted row height and the number of rows in the symbol. For some symbologies also the module width is relevant for the symbol height.
hDC can be NULL. In this case the bounding rectangle must be specified in 1/1000 mm. The measurement units are: - eMUDefault ... logical units of the given device context. - eMUMM ... millimeters - eMUPixel ... pixels if device context is given, otherwise points (= 1/72 inch)

See also:
BCGetBarcodeSize(), BCGetBarcodeWidth(), BCSetModWidth(), BCSet_PDF417_RowHeight()
Note:
Call this function after BCCreate(). Please take care of rotation if you use the result of this function to calculate the bounding rectangle for drawing. If you use a rotation of 90° or 270° the width is calculated from rect.top and rect.bottom and the height from rect.left and rect.right (return values depend on size mode and module width settings). \param[in] pBarCode Pointer to barcode structure. \param[in] pRect Bounding rectangle. \param[in] hDC Device context handle. \param[in] eUnit Measurement unit.
Return values:
LONG   Height of barcode symbol ----------------------------------------------------------------------------.

ERRCODE BCGetBarcodeSize ( t_BarCode * pBarCode,
LPRECT pRect,
HDC hDC,
e_MUnit eUnit,
DOUBLE * pdWidth,
DOUBLE * pdHeight )

Computes the barcode size (recommended method). Computes width and height of barcode with one call. You can use this function before you draw the barcode to ensure that there is enough space available. Call this function after BCCreate() and specify a bounding rectangle (target coordinates, where you would draw the barcode). This rectangle is relevant if you haven't specified a module width or a row height. As for the bounding rectangle pass in the same coordinates as you would use for drawing. Some symbologies have a specific width/height ratio and therefore the bar code size is adapted to fit into the bounding rectangle.
hDC can be NULL. In this case the bounding rectangle must be specified in 1/1000 mm. The measurement units are: - eMUDefault ... logical units of the given device context. - eMUMM ... millimeters - eMUPixel ... pixels if device context is given, otherwise points (= 1/72 inch)

See also:
BCGetBarcodeHeight(), BCGetBarcodeWidth()
Note:
Call this function after BCCreate(). Please take care of rotation if you use the result of this function to calculate the bounding rectangle for drawing. With a rotation of 90° or 270° the width is calculated from rect.top and rect.bottom and the height from rect.left and rect.right (return values depend on size mode and module width settings). \param[in] pBarCode Pointer to barcode structure. \param[in] pRect Bounding rectangle. \param[in] hDC Device context handle. \param[in] eUnit Measurement unit. \param[in, out] pdWidth Pointer to resulting width (NULL if not required). \param[in, out] pdHeight Pointer to resulting height (NULL if not required).
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.

DOUBLE BCGetBarcodeWidth ( t_BarCode * pBarCode,
LPRECT pRect,
HDC hDC,
e_MUnit eUnit )

Returns the total width of the barcode symbol. Returns the total barcode width in the specified measurement unit for a given device context. You can specify the measurement unit, which should be used for the return value. Use BCGetBarcodeSize() if you also need the height of the symbol. As for the bounding rectangle pass in the same coordinates as you would use for drawing. Some symbologies have a specific width/height ratio and therefore the bar code size is adapted to fit into the bounding rectangle. If a module width has been set, the bar code width depends on the module width and the number of horizontal modules.
hDC can be NULL. In this case the bounding rectangle must be specified in 1/1000 mm. The measurement units are: - eMUDefault ... logical units of the given device context. - eMUMM ... millimeters - eMUPixel ... pixels if device context is given, otherwise points (= 1/72 inch)

See also:
BCGetBarcodeHeight(), BCGetBarcodeSize(), BCSetModWidth()
Note:
Call this function after BCCreate(). Please take care of rotation if you use the result of this function to calculate the bounding rectangle for drawing. If you use a rotation of 90° or 270° the width is calculated from rect.top and rect.bottom and the height from rect.left and rect.right (return values depend on size mode and module width settings). \param[in] pBarCode Pointer to barcode structure. \param[in] pRect Bounding rectangle. \param[in] hDC Device context handle. \param[in] eUnit Measurement unit.
Return values:
LONG   Width of barcode symbol ----------------------------------------------------------------------------.

DOUBLE BCGetCountModules ( const t_BarCode * pBarCode )

Returns the number of modules in the barcode. Returns the number of modules for the current barcode with respect to encoded data, check-digits, subset and other barcode parameters. With 2D symbologies the total number of all modules (in all rows) will be returned.

Note:
To be used with linear symbologies.
Call this function after BCCreate()
See also:
BCGet2D_XCols()
Returns:
Number of modules ----------------------------------------------------------------------------.

LONG BCGetCountRows ( const t_BarCode * pBarCode )

Returns the number of rows in the barcode. Returns the number of rows in multi-row symbologies (PDF417, Data Matrix, Codablock-F, QR-Code, MicroPDF417, RSS Stacked versions)

Note:
To be used with the following symbologies: PDF417, Data Matrix, Codablock-F, QR-Code, MicroPDF417
Call this function after BCCreate()
See also:
BCGet2D_XRows() \param[in] pBarCode Pointer to barcode structure.
Return values:
LONG   Number of rows ----------------------------------------------------------------------------.

DOUBLE BCGetModuleWidth ( t_BarCode * pBarCode,
LPRECT pRect,
HDC hDC,
e_MUnit eUnit )

Returns the module width. Returns the computed module width for a given device context with respect to encoded data, check-digits, subset and other barcode parameters. You can specify the unit, which should be used for the return value.
hDC can be NULL. In this case the bounding rectangle must be specified in 1/1000 mm. The measurement units are: - eMUDefault ... logical units of the given device context. - eMUMM ... millimeters - eMUPixel ... pixels if device context is given, otherwise points (= 1/72 inch)

Note:
Call this function after BCCreate() \param[in] pBarCode Pointer to barcode structure. \param[in] pRect Bounding rectangle. \param[in] hDC Device context handle. \param[in] eUnit Measurement unit.
Return values:
LONG   Module width ----------------------------------------------------------------------------.

ERRCODE BCGetOptimalBitmapSize ( t_BarCode * pBarCode,
LPRECT pRect,
LONG nScaleX,
LONG nScaleY )

Returns the optimal size of a bitmap for given bar code settings. The optimal bitmap size depends on the number of horizontal bar/space modules and also on the number of vertical rows (multi-row or matrix codes). The default height for linear codes can be preset by the pRect->bottom parameter. This function also takes the DPI property into account. You can use the returned values as input for the save image functions.

Note:
This function calculates the bar code size for a rotation of 0 degrees.
If a quiet zone is set, it is considered automatically by GetOptimalBitmapSize. But note that only quiet zones given in modules or pixels can be handled. The other units lead to an error because a device context would be needed for a proper bitmap size calculation. If you apply the results for a rotated bar code of 90° or 270° you have to exchange width and height.
See also:
BCSetDPI(), BCSaveImage(), BCSaveImageToBuffer(), BCBitmapToFile(), BCBitmapToMemory() \param[in] pBarCode Pointer to barcode structure. \param[in, out] pRect [in] The size of the bounding rectangle without HRT (for barcode orientation of 0 degrees) in Pixels. [out] The size of the optimal bitmap including HRT (if any) in Pixels. \param[in] nScaleX Horizontal scaling factor. \param[in] nScaleY Vertical scaling factor.
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.

DOUBLE BCGetTextAreaHeight ( t_BarCode * pBarCode,
LPRECT pRect,
HDC hDC,
e_MUnit eUnit )

Returns the height of the human readable text area. Returns the height of the human readable text area in the specified measurement unit.
hDC can be NULL. In this case the bounding rectangle must be specified in 1/1000 mm. The measurement units are: - eMUDefault ... logical units of the given device context. - eMUMM ... millimeters - eMUPixel ... pixels if device context is given, otherwise points (= 1/72 inch) \param[in] pBarCode Pointer to barcode structure. \param[in] pRect Bounding rectangle. \param[in] hDC Device context handle. \param[in] eUnit Measurement unit.

Return values:
0   If no text-area used for barcode.
>0   Height of text-area in the specified measurement units. ----------------------------------------------------------------------------.


© 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