Bar2Dh3

Calls to Bar2Dh3() are used to draw the barcode image on a device context while ensuring that the bars aligns with integer numbers of pixels on a device of a specified resolution. This is useful for printing to low resolution printers such as thermal label printers.

 

int WINAPI Bar2Dh3(HDC hDC, LPRECT lpr, LPBAR2D bc, BOOL bPrinting,
int xRes, int yRes);

where hDC is the target device context,

lpr is a pointer to the target rectangle in HIMETRIC units

bc is a BARCODE2D structure - the LPBAR2D cast is required.

bPrinting is true if the output is to a printer or false otherwise

xRes and yRes are the horizontal and vertical resolutions of the target printer

This function produces barcode images in which the bar widths are whole numbers of pixels of the target printer as defined by the resolutions xRes and yRes; as the bars are aligned to pixels the width of the barcode may not be exactly as expected.

If bPrinting is true then the barcode is produced on the printer device context at the resolution specified; if bPrinting is false then the barcode is produced n the hDC but scaled to have the size it would have when reproduced at the resolution specified – which is not necessarily the save as that of the hDC.

 

 

More:

GhDlsbar2D()