ITBarCode.SaveImageEx

ITBarCode

HRESULT SaveImageEx([in] LONG_PTR hDC, [in] BSTR sFileName, [in]e_IMType eImageType, [in]LONG nQuality, [in]LONG nXSize, [in]LONG nYSize, [in]DOUBLE dXRes, [in]DOUBLE dYRes)

Deprecated

use function SaveImageEx2() instead.

Saves the content of the barcode object as image-file with respect to a specified device context (if not needed hDC can be set to 0).
The values of XSize and YSize should be increased, if the barcode is not readable or if the data density is high. The values of XRes and YRes can affect the printing size when printing from graphic- or painting programs.
The image quality sets the compression algorithm (depending on the image type), too.
With Vector EPS files you can choose between using Windows fonts (nQuality = 0) and using Postscript compatible fonts (nQuality = 1).

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 ".bmp", ".emf", ".eps", ".gif", ".jpg", ".jpeg", ".pcx", ".png", ".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 SaveImageEx, site locking prevents unauthorized web sites from saving images to your local drive. If you want to allow certain websites to call SaveImageEx 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 desired directory.

Parameters

Parameter / typeDescription
[in] hDC LONG_PTR

Handle of the Device Context. NULL or 0 if not needed.

[in] sFileName BSTR

Full or relative filename of the output file (*.JPG, *.BMP, *.EMF,...).

[in] eImageType e_IMType

Type of the image.

[in] nQuality LONG

Quality of the image in connection with a compression algorithm. Also used for font management in Vector EPS output files

[in] nXSize LONG

Horizontal size of the barcode in device context units (according to the actual mapping mode). For EPS the unit is [0.001mm]

[in] nYSize LONG

Vertical size of the barcode in device context units (according to the actual mapping mode). For EPS 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
(
  hDC As Long,
  sFileName As String, 
  eImageType As tag_ImageType,      /* As Long if enumeration is not available */
  nQuality As Long,
  nXSize As Long, 
  nYSize As Long, 
  dXRes As Double, 
  dYRes As Double
)

Search documentation

Search in
More scopes
Additional scopes

All contents