ITBarCode.SaveImage
HRESULT SaveImage([in] BSTR sFileName, [in]e_IMType eImageType, [in]LONG nXSize, [in]LONG nYSize, [in]DOUBLE dXRes, [in]DOUBLE dYRes)Saves the content of the barcode object as image-file (Format Bmp, Jpg, EMF, etc).
The values of XSize and YSize should be increased, if the barcode is not readable or if the barcode contains more data as usual. The values of XRes and YRes can affect the printing size when printing from graphic- or painting programs.
A file extension according to selected image type is appended automatically if the file name does not already end with a safe file extension. Safe file extensions are ".ai", ".bmp", ".emf", ".eps", ".gif", ".jpg", ".jpeg", ".pcl", ".pcx", ".png", ".svg", ".tif", and ".tmp".
Microsoft Internet Explorer
If you use TBarCode OCX in client side web applications (MSIE), the file saving functions are guarded by the Site lock mechanism. Site locking is used to prevent possibly harmful websites from damaging your local system using TBarCode OCX. In the case of SaveImage, site locking prevents unauthorized web sites from saving images to your local drive. If you want to allow certain websites to call SaveImage you have to specify this manually (see Security).
Note
If used within web applications (ASP, PHP), ensure that the web server (user) has the rights for writing into the specified directory.
Parameters
| Parameter / type | Description |
|---|---|
[in] sFileName BSTR |
Full or relative filename of the output file (*.JPG, *.BMP, *.EMF,...) |
[in] eImageType e_IMType |
Type of the image. |
[in] nXSize LONG |
Horizontal size of the barcode in pixels. For vector formats (EPS, AI, SVG...) the unit is [0.001mm] |
[in] nYSize LONG |
Vertical size of the barcode in pixels. For vector formats (EPS, AI, SVG...) the unit is [0.001mm] |
[in] dXRes DOUBLE |
Horizontal resolution in [dpi]. |
[in] dYRes DOUBLE |
Vertical resolution in [dpi]. |
Returns
None.
Exception:
On error an exception is thrown.
Visual Basic Syntax:
SaveImage
(
sFileName As String,
eImageType As tag_ImageType, /* As Long if enumeration is not available */
nXSize As Long,
nYSize As Long,
dXRes As Double,
dYRes As Double
)