TBarCode Library 11  TBarCode Library 11
ERRCODE _stdcall BCSaveImageToBuffer ( t_BarCode pBarCode,
LPBYTE *  lpBuffer,
e_IMType  eImageType,
LONG  lXSize,
LONG  lYSize,
DOUBLE  dXRes,
DOUBLE  dYRes 
)

Saves barcode as image into a memory buffer (Windows only).

Draws the barcode and saves it using the specified image format to a memory buffer (pass a pointer variable of an arbitrary type as argument). The values of XSize and YSize should be increased, if the barcode is not readable or requires a high printing resolution. The values of XRes and YRes can affect the printing size when printing from graphic- or painting programs (but not when printing from the browser!). The buffer will be allocated on the global heap. Retrieve the buffer size in Bytes with GlobalSize((HGLOBAL)GlobalHandle(buffer)). It is recommended to lock the buffer before reading with pMem = GlobalLock (hMem) and unlock it afterwards (GlobalUnlock(hMem)). When no longer needed the buffer must be released by calling GlobalFree(hMem) (WINDOWSX.h macro).

Note:
WINDOWS only. This function can be used with a developer license only.
See also:
BCSaveImageToBufferEx()
Parameters:
[in]pBarCodePointer to barcode structure.
[out]lpBufferBuffer.
[in]eImageTypeEnumeration for the type of the image.
[in]lXSizeX-Size of the image [pixel]. For vector formats the unit is [0.001 mm]
[in]lYSizeY-Size of the image [pixel]. For vector formats the unit is [0.001 mm]
[in]dXResX-Resolution of the image [pixels / inch].
[in]dYResY-Resolution of the image [pixels / inch].
Return values:
ERRCODEErrOk (0) in case of success. Non-zero if error occurred.