Description This method writes a barcode with the given parameters to a DIB. This method works for only 1, 8 and 24 bit per pixel images, where the color palette contains the black (RGB(0, 0, 0)) and white colours (RGB(255, 255, 255)). The rectangle to writethe barcode to, and the alignment are adjustable. The widths of bars/spaces, difference between two neighbouring logical level bars/spaces, minimal widths are also adjustable. If the whole given rectangle is to be used, set bFitToRect to TRUE, but if a perfect barcode is needed, don’t use this parameter, because scaling and rounding can produce different widths for bars/spaces in the same logical width level. The string to code has to be standard for the given type barcodes, for possible barcode values see Valid barcode values. If the specified barcode standard supports checksum digits, WriteBarCodeToRectangle method always generates the checkdigit(s).
If a barcode is rotated and tried to be read back as a skewed barcode later, use the thickest bars and spaces that are possible for the given space. ErrorCode is a value that shows the code of occurred error. For possible values see Barcode Error codes. The ErrorCode value can be retrieved by the method GetErrCode.
Syntax RetVal = [BiBrw1Dh]WriteBarCodeToRectangle hDIB cBuffer iMinimalBarWidth iMinimalSpaceWidth iRatio iEmptyFrameSize bOpacity bWriteText
Returns RetVal LONGLONG Handle of the new DIB with the given barcode or NULL on error. On failure call the GetErrCode method for the code of the error occured
Remarks hDib LONGLONG Device independent bitmap.
cBuffer String Barcode Value to code.
iMinimalBarWidth Short Minimal width of bars, cannot be less than 1. If bFitToRect is true, this value doesn’t make any effect.
iMinimalSpaceWidth Short Minimal width of spaces, cannot be less than 1. If bFitToRect is true, this value doesn’t make any effect.
iRatio Short Minimal width difference between two neighbouring logical level bars or spaces, cannot be less than 1
iEmptyFrameSize Short Width of empty frame size in pixels around the barcode in the given rectnagle. Cannot be less than 1.
bOpacity Boolean If bOpacity is FALSE, only the bars will be displayed on the image, space pixels don’t change.
bWriteText Boolean Exactly fit the written barcode to the given rectangle.
See Also GetErrCode