10350 Santa Monica Blvd. Suite 285, Los Angeles, CA 90025
Phone: 310-691-8920, 310-788-9840, Fax: 419-735 -2419
Card Scanning Solutions
38
1.1.44.
ReformatImage
Format
Parameters
[in]
SourceImage
– Full path name of the original image file. If this string is empty the
rotation is performed on the internal image.
[in]
toColor
– One of five values:
LICENSE_INVALID
– Library was not initialized with proper license.
IMAGE_SAME_COLOR
– no modification in the image color scheme
IMAGE_BW
– Convert to black and white color scheme.
IMAGE_GRAY_256
– convert to 256 gray scale color scheme.
IMAGE_COLOR_256
– convert to 256-color scheme.
IMAGE_CO LOR_TRUE
– convert to true color scheme.
[in]
toDpi
– Set the new Image DPI. A value of 0 indicate no DPI modification.
[in]
DestImage
– Full path name of the destination file. Is this value is an empty string no save will
be performed.
Return
If function succeeds, the return the value
IMG_ERR_SUCCESS.
If the function fails it returns one of the following values:
IMG_ERR_BAD_COLOR
– Bad
toColor
parameter value.
IMG_ERR_BAD_DPI
– Bad
toDpi
parameter value.
IMG_ERR_FILE_OPEN
– Cannot open input file. T his value is returned if the
SourceImage
string is not empty but it points to a missing or invalid source image file.
INVALID_INTERNAL_IMAGE
– This value is returned if the
SourceImage
string is empty but
no document was scanned so there is no internal image in the memory.
IMG_ERR_FILE_SAVE_TO_FILE
– Cannot save destination file.
IMG_ERR_FILE_SAVE_TO_FILE
– Cannot save destination file due to invalid destination file or
disk save error.
Remarks
Use this function to modify the image color scheme and resolution and save it to a file in any one of
seven formats. The manipulated image may be loaded from an external file (if
SourceImage
string
holds a string value equal to the source image file name) or performed on the internal image buffer (if
SourceImage
string is empty). When using a file as the image source, it is important to use the
proper file extension to indicate the image format. Proper extension types are: BMP, JPG, TIFF, PCX,
PNG, TGA and PSD. If an image has unrecognizable extension due to an error (e.g. TIFF instead of
TIF) the function refers to the file as BITMAP.
ReformatImage ( _
SourceImage
As String, _
toColor
As Integer, _
toDpi
As Integer, _
DestImage
As String _
)