ImageGear for C and C++ on Windows v19.10 - Updated
IG_ISIS_drv_set_dialog
API Reference Guide > ISIS Component API Reference > ISIS Component Functions Reference > Driver Communication and Setup Functions > IG_ISIS_drv_set_dialog

Display scanner settings dialog box.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_ISIS_drv_set_dialog(
        HISISDRV hDriver,
        HWND hWnd,
        HINSTANCE hInst,
        AT_LMODE lFlags
);

Arguments:

Name Type Description
hDriver HISISDRV The handle of the driver for which this dialog box is being displayed.
hWnd HWND A handle to the parent window.
hInst HINSTANCE A handle to the application instance window.
lFlags AT_LMODE Future versions of ISIS may allow lFlags to restrict access to the settable values in the dialog box. The values of lFlags are as follows:
dwFlags Meaning
0 Display normal Scanner Settings dialog box.
IG_ISIS_DRV_SET_DIALOG_BIN Restrict the scanner settings to binary, effectively preventing the user from choosing grayscale or color modes.
IG_ISIS_DRV_SET_DIALOG_AREA Show the Area button on the dialog box. When the user clicks the Area button, the Area dialog box appears. When not set, the Area button is not visible.
IG_ISIS_DRV_SET_DIALOG_AREAPREVIEW When set, if the user clicks on the Area button, the dialog displayed will include a preview box where the user can set the scan area through mouse actions. The preview box may display an image if a callback function has been set with IG_ISIS_area_dialog_CB_register, otherwise it will be gray. Using this flag automatically sets the IG_ISIS_DRV_SET_DIALOG_AREA flag as well. The MVIEW sample included with the toolkit shows how this flag may be used.
IG_ISIS_DRV_SET_DIALOG_RETURN When set, if the user clicks Cancel, IG_ISIS_drv_set_dialog returns IG_ISIS_ERR_CANCEL. If the user clicks OK, it returns IG_ISIS_SUCCESS. If this flag is not set, IG_ISIS_drv_set_dialog always returns IG_ISIS_SUCCESS. The Scanner Settings dialog box lets you access a scanner-specific More Settings dialog box for scanners that support this feature. Note that the More button appears dimmed in the dialog box unless IG_ISIS_TAG_MORE_SETTINGS exists in the scanner driver currently selected, and is set to 1. The More dialog can also be displayed by using the IG_ISIS_drv_set_more function: lStatus = IG_ISIS_drv_set_more(lpDriver, hWnd); where hWnd is the handle of the parent window.

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.

Example:

The following example restores saved tag values from a file, then displays the Scanner Settings dialog, allowing the user to make whatever changes are desired. Finally, it saves any changes made back to the file.

 
Copy Code
/* Get saved tag values                                                                                                        */IG_ISIS_tag_restore_file(hScan, 0, "SETSCAN.INI");
/* Display dialog                                                                                               */IG_ISIS_drv_set_dialog (hScan, hWnd, 0);
/* Save any changes from using the dialog                                                       */IG_ISIS_tag_save_file(hScan, 0, "SETSCAN.INI");

Remarks:

The IG_ISIS_drv_set_dialog function displays a predefined dialog box that allows the user to set scanning parameters, such as resolution, dither pattern, brightness, contrast, and so forth.

Application developers should use this function rather than setting scanner parameters explicitly. Applications will then be better able to take advantage of new scanner capabilities as these capabilities are released in new scanner drivers. By using the IG_ISIS_drv_set_dialog function, the new capabilities will appear automatically whenever a new scanner driver is connected.

In all cases except the Kodak IL900 and IL500 scanner drivers, changing the Settings dialog box changes the tags that will be used to scan a page. The tags do not get sent until a scan is started. On the Kodak drivers, the user is asked whether or not to send the tags when they click OK in the Settings dialog box.

The built-in Scanner Settings dialog looks similar to this:

This dialog box encompasses the standard settings available on most scanners; however, it may vary depending on the selected scanner. The lower left corner of the dialog displays the Pixdflt and scanner driver version numbers. Buttons along the right edge of the dialog perform the following predefined operations:

Default Returns all settings in this dialog box to their factory default settings. Factory default settings are established by the person who wrote the scanner driver. Note that factory defaults for Brightness and Contrast may be off-center based on tests conducted with the scanner to determine the setting which gives best results with "normal" pages.
Area... Displays the predefined Area dialog box, which allows users to specify an area of the page to scan.
More... Displays a scanner driver-specific dialog box with additional settings. If no additional settings are available, the More.. button does not appear.
Filters... Displays the predefined Filter Selection dialog box, which allows users to enable and disable image-enhancement filters that were installed in the Scanner Selection dialog. If no filters were installed, the Filters... button is dimmed. The Filters dialog box looks like this, with the actual filter names listed in the two windows:

See Also:

IG_ISIS_tag_restore_file

IG_ISIS_tag_restore_value

IG_ISIS_tag_save_file

IG_ISIS_tag_save_value

IG_ISIS_drv_area_dialog

IG_ISIS_drv_set_more

IG_ISIS_area_dialog_CB_register