TBarCode Library 11  TBarCode Library 11
DOUBLE _stdcall 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).
    Parameters:
    [in]pBarCodePointer to barcode structure.
    [in]pRectBounding rectangle.
    [in]hDCDevice context handle.
    [in]eUnitMeasurement unit.
    Return values:
    LONGHeight of barcode symbol