LoadImageEx()

Description

Loads local image(s) into Dynamic Web TWAIN.

Syntax

.LoadImageEx(fileName, imageType, [optionalAsyncSuccessFunc, optionalAsyncFailureFunc]);

Parameters

<string> fileName: specifies the absolute path to open the file.
EnumDWT_ImageType (int) imageType: specifies the format.

Type Numeric Value
IT_BMP 0
IT_JPG 1
IT_TIF 2
IT_PNG 3
IT_PDF 4
IT_ALL 5

The following two parameters are optional. If either one exists or both exist, the method is asynchronous, otherwise it's synchronous.

<OnSuccess function> optional optionalAsyncSuccessFunc: callback function triggered when the file is loaded successfully.
<OnFailure function> optional optionalAsyncFailureFunc: callback function triggered when the file failed to be loaded.

Please refer to the function prototype OnSuccess or OnFailure.

Return value

Only valid when used synchronously.

bool

true indicates success. false indicates failure.

When false is returned, check ErrorCode or ErrorString for error information.

Remarks

If you would like to load/open images by showing the 'Open File' dialog box, you can set IfShowFileDialog to true.

See also

LoadImage
IfShowFileDialog

Example

DWObject.IfShowFileDialog = true;
    DWObject.LoadImageEx("", EnumDWT_ImageType.IT_ALL);