ImageGear for C and C++ on Windows v20.5 - Updated
IG_ISIS_tag_save_file_ex
API Reference Guide > ISIS Component API Reference > ISIS Component Functions Reference > Tag Functions > IG_ISIS_tag_save_file_ex

Save current tag values to a function pointer.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_ISIS_tag_save_file_ex(
        HISISDRV hDriver,
        LPFNIG_ISIS_SAVEEX lpfnCallback,
        LPSTR lpszFileName
);

Arguments:

Name Type Description
hDriver HISISDRV The handle to the driver.
lpfnCallback LPFNIG_ISIS_SAVEEX Points to a callback function defined by the application.
lpszFileName LPSTR Specifies the name of the file or data object in which to save the current tag values. Passed directly to the callback.

Return Value:

Returns the number of ImageGear errors that occurred during this function call. If there are no errors, the return value is IGE_SUCCESS.

Supported Raster Image Formats:

This function does not process image pixels.

Remarks:

The IG_ISIS_tag_save_file_ex function outputs the current values of all tags to a function pointer that can be used by a callback procedure. This allows an application to save the values of all tags in an application-defined data object.

Use IG_ISIS_tag_save_file_ex to save the current values of all tags in a data object of the application's choice. This function accomplishes the same functionality as IG_ISIS_tag_save_file except that rather than writing the tag values to a specified file, it sends a message to a callback function each time a value would otherwise be written to a file. Use this function together with a callback function to give the application the capability to save the current scanner settings, then use IG_ISIS_tag_restore_file_ex to restore the settings at a later time.

Example:

The following code fragment defines a callback function:

 
Copy Code
LPFNIG_ISIS_SAVEEX SampleSaveCallback;
int SampleSaveCallback(char FAR *lpszSection, char FAR
        *lpszEntry, char FAR *lpszString, char FAR *lpszFileName);
{
        if ((WritePriveProfileString(lpszSection, lpszEntry, lpszString,
                lpszFileName)
                return IGE_SUCCESS;
        else
                return IGE_ERROR;
}

The following code fragment defines a function that uses the callback:

 
Copy Code
int SaveScanTags(hDriver, HWND hWnd, char FAR *lpszFileName)
{
        AT_ERRCOUNT nErrCount;
        if (hDriver) {
                nErrCount = IG_ISIS_tag_save_file_ex(hDriver, SampleSaveCallback,
                                                           lpszFileName);
        } 
        return nErrCount;
}

Structures:

The callback's prototype looks like this:

 
Copy Code
typedef INT (LPACCUAPI LPFNIG_ISIS_SAVEEX)(
        LPSTR lpszSection,
        LPSTR lpszEntry,
        LPSTR lpszString,
        LPSTR lpszFileName
        );

See Also

IG_ISIS_tag_restore_file_ex

Is this page helpful?
Yes No
Thanks for your feedback.