ITBarCode.ConvertToStream
VARIANT * ConvertToStream(e_IMType eImageType, Long nXSize, Long nYSize, Double dXRes, Double dYRes)Returns the content of the barcode object as image-data stream.
This stream can be sent to the client browser (e.g. with Response.BinaryWrite in ASP on the server). The image format can be any supported bitmap format (no vector format). For web-applications PNG, GIF or JPG are recommended. The size of the bitmap [pixel] and the resolution [dpi] can be selected separately for X and Y dimension.
Quality
For getting best barcode quality with bitmap formats use GetOptimalBitmapSize. Alternatively increase the values of XSize and YSize if the barcode is not readable or if the barcode requires high data density. 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).
Note
This method is optimized for web-applications. It is available only in connection with a Developer- or Web-License (but can be tested within the demo version).
Note
PHP: Because the data type „Variant“ is not fully supported within PHP, we suggest to use the method SaveImage to save the barcode temporarily as image file (which can be referred to at the client-side within the HTML-Code).
Parameters
| Parameter / type | Description |
|---|---|
[in] eImageType e_IMType |
Type of the image (eIMBmp, eIMJpg, eIMPcx, eIMPng, eIMGif, eIMTif) |
[in] nXSize Long |
Horizontal size of the barcode in pixels. |
[in] nYSize Long |
Vertical size of the barcode in pixels. |
[in] dXRes Double |
Horizontal resolution in [dpi]. The appearance in a browser is not affected by this setting. |
[in] dYRes Double |
Vertical resolution in [dpi]. The appearance in a browser is not affected by this setting. |
Returns
DataStream As Variant encapsulating a Byte Array (supported by ASP and .NET).
Exception:
On error an exception is thrown.
Visual Basic Syntax:
VARIANT ConvertToStreamEx
(
hDC As Long,
eImageType As e_IMType, /* As Long if enumeration is not available */
nQuality As Long,
nXSize As Long,
nYSize As Long,
dXRes As Double,
dYRes As Double
)