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 (multirow 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()
 Parameters:

[in]  pBarCode  Pointer to barcode structure. 
[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. 
[in]  nScaleX  Horizontal scaling factor. 
[in]  nScaleY  Vertical scaling factor. 
 Return values:

ERRCODE  ErrOk (0) in case of success. Nonzero if error occurred. 