Group 2 calls

The Group 2 library calls use a BARCODE2D structure embedded in the DLL which can be accessed and edited through a dialog displayed by the Bar2DAsk() or Bar2DaskEx() functions. The contents of the embedded structure may also be filled by calling Bar2Din() and retrieved by calling Bar2Drd().

With these exceptions the Group 2 calls mirror the Group 1 calls, and the prototypes are listed below.

 

int WINAPI Bar2DAsk( NULL,LPINT lpEnable);
int WINAPI Bar2DAskEx( NULL,LPINT lpEnable);

These calls display a dialog box that allows the barcode properties to be selected. Pushing the OK button in the dialog stores the selected barcode properties in the embedded BARCODE2D structure. If the lpEnable parameter points to a non-zero value the parameters are stored and will be available for future runs of the calling program; if the lpEnable parameter points to a zero value the data is not stored and will be lost when the program terminates.

The Bar2DAsk call will load previously stored values into the embedded BARCODE2D structure if either no other values have been set (eg. by Bar2Din) or if lpEnable is non-zero.

The Bar2DAskEx call does NOT load previously stored values, and it is the programmers responsibility to ensure that the embedded BARCODE2D structure has been filled prior to calling this function.

 

 int WINAPI Bar2Din(LPBAR2D bc, BOOL bt);

Calls to Bar2Din fill the embedded BARCODE2D structure with the data contained in the structure pointed to by bc. If bt is non-zero (True) this data is stored and will be available for future runs of the calling program; if bt is 0 (False) the data is not stored and will be lost when the program terminates.

 

int WINAPI Bar2Drd(LPBAR2D bc);

Calls to Bar2Drd return the current contents of the embedded BARCODE2D structure in the structure pointed to by bc.

 

 int WINAPI Bar2D2m(LPSTR bufin, LPRECT lpRect,LPHANDLE hmf);

Calls to Bar2D2m create the barcode metafile image using the barcode data in the string pointed to by bufin and the properties specified in the embedded BARCODE2D structure; the metafile handle is placed in hmf and the rectangle containing the image (in HIMETRIC units) is placed in the RECT structure pointed to by lpRect. The call returns an error code in the event of an error, otherwise it returns 0.

 

 int WINAPI Bar2D2mx(HDC hDCref,LPSTR bufin,LPRECT lpRect,LPHANDLE hemf);

Calls to Bar2D2mx create the barcode enhanced metafile image using the barcode data in the string pointed to by bufin and the properties specified in the embedded BARCODE2D structure, and the reference hDCref (which may be NULL) is used in the creation of the enhanced metafile; the enhanced metafile handle is placed in hemf and the rectangle containing the image (in HIMETRIC units) is placed in the RECT structure pointed to by lpRect. The call returns an error code in the event of an error, otherwise it returns 0.

 

 int WINAPI Bar2D2b(LPSTR bufin,int imult,LPHANDLE hbm);

Calls to Bar2D2b create the barcode bitmap image using the barcode data in the string pointed to by bufin and the properties specified in the embedded BARCODE2D structure; the bitmap handle is placed in hbm and is imult times larger than the size specified in the embedded BARCODED3D structure . The call returns an error code in the event of an error, otherwise it returns 0.

 

int WINAPI Bar2D2d(LPSTR bufin,int imult,LPHANDLE hdib);

Calls to Bar2D2d create the barcode Device Independent Bitmap image using the barcode data in the string pointed to by bufin and the properties specified in the embedded BARCODE2D structure; the DIB handle is placed in hdib and is imult times larger than the size specified in the embedded BARCODED3D structure . The call returns an error code in the event of an error, otherwise it returns 0.

 

int WINAPI Bar2D2b3(LPSTR bufin,int ires,int imult,LPHANDLE hbm);

The Bar2D2b3 function is provided for creating bitmap images of a specified resolution (ires) in dpi, but is otherwise the same as Bar2D2b().

 

int WINAPI Bar2D2b3(LPSTR bufin,int ires,int imult,LPHANDLE hbm);

The Bar2D2d3 function is provided for creating bitmap images of a specified resolution (ires) in dpi, but is otherwise the same as Bar2D2d().

 

int WINAPI Bar2D2h2(HDC hDC,LPSTR bufin,LPPOINT lpPt);

Calls to Bar2D2h2 draw an enhanced metafile image into the Device Context hDC using the barcode data in the string pointed to by bufin and the properties specified in the embedded BARCODE2D structure, with the top,left coordinates being pointed to by the lpPt parameter (in HIMETRIC units). The call returns an error code in the event of an error, otherwise it returns 0.

 

int WINAPI Bar2D2c(LPSTR bufin);

Calls to Bar2D2c copy the image of the barcode to the Windows Clipboard, using the barcode data in the string pointed to by bufin and the properties specified in the embedded BARCODE2D structure. The call returns an error code in the event of an error, otherwise it returns 0.

 

int WINAPI Bar2D2f(LPSTR bufin,LPSTR szFileName);

Calls to Bar2D2f copy an image of the barcode to the file pointed to by szFileName, using the barcode data in the string pointed to by bufin and the properties specified in the embedded BARCODE2D structure. The call returns an error code in the event of an error, otherwise it returns 0.

The szFileName string must contain the full pathname of the file required, including one of the permitted file extension which specify the file type. The allowed extension are:

.WMF – Windows metafile
.BMP – Windows bitmap
.PCX – Paintbrush file
.EPS – Encapsulated PostScript
.PNG – Portable Network Graphics
.GIF – GIF file (requires Unisys GIF licence)

Note that graphic files based on bitmaps should have a target resolution specified by calling SetBitmapScale() before saving the file.

 

 int WINAPI Bar2D2f2(HDC hDC,LPSTR bufin,LPSIZE lps,LPSTR szFileName);

Calls to Bar2D2f2 copy an image of the barcode to the file pointed to by szFileName, using the barcode data in the string pointed to by bufin and the properties specified in the embedded BARCODE2D structure. The call returns an error code in the event of an error, otherwise it returns 0.

The Bar2D2f2 function generates a bitmap-type barcode image suitable for reproduction on the hDCref device context at the size specified in the lps size. This function does not generate metafile picture files.

The szFileName string must contain the full pathname of the file required, including one of the permitted file extension which specify the file type. The allowed extensions are those specified for the Bar2D2f calls except that .WMF files are not permitted.

Note that graphic files based on bitmaps should have a target resolution specified by calling SetBitmapScale() before saving the file.

 

More:

Other calls