Set a callback function to display a preview image in the scan area dialog.
Copy Code
|
|
---|---|
AT_ERRCOUNT ACCUAPI IG_ISIS_area_dialog_CB_register( HINSTANCE hInst, LPFNIG_ISIS_AREA lpfnCB, DWORD lParam ); |
Name | Type | Description |
---|---|---|
hInst | HINSTANCE | Specifies the handle to the application instance. |
lpfnCB | LPFNIG_ISIS_AREA | Pointer to area dialog callback function. |
lParam | DWORD | 32-bit value which will be passed as the lParam parameter to your callback function. |
Returns the number of ImageGear errors that occurred during this function call. If there are no errors, the return value is IGE_SUCCESS.
This function does not process image pixels.
The following example shows IG_ISIS_area_dialog_CB_register being used before each call to IG_ISIS_drv_set_dialog. The application's callback function "MyAreaCallback" will be used by the toolkit if the user clicks on the "Area..." button.
Copy Code
|
|
---|---|
LPFNIG_ISIS_AREA lpfnAreaCB; lpfnAreaCB = (LPFNIG_ISIS_AREA)MakeProcInstance( (FARPROC)MyAreaCallback, hInst);IG_ISIS_area_dialog_CB_register(hInst, lpfnAreaCB, (DWORD)(void FAR *)mPage);IG_ISIS_drv_set_dialog(hScan, hWnd, IG_ISIS_DRV_SET_DIALOG_AREAPREVIEW); if (lpfnAreaCB) FreeProcInstance((FARPROC)lpfnAreaCB); |
IG_ISIS_area_dialog_CB_register designates a callback function to be used when displaying an image in the preview box of the scan area dialog.
When displaying an area dialog using the IG_ISIS_DRV_SET_DIALOG_AREAPREVIEW flag, you have the option of showing a page preview in the preview box. IG_ISIS_area_dialog_CB_register provides the toolkit with the function that will actually draw the preview.
Call IG_ISIS_area_dialog_CB_register before each call to IG_ISIS_drv_area_dialog or IG_ISIS_drv_set_dialog in order to provide your own callback function to draw the preview.
The IG_ISIS_DRV_SET_DIALOG_AREAPREVIEW flag does not imply that a callback will be used. If this flag is used when displaying an area dialog without first providing a callback function the toolkit will display a gray preview box without drawing an image in it.
The toolkit uses the tags provided by the callback to properly scale the drawing rectangle so that the preview image fits into the correct portion of the preview box independent of the current scanner resolution and page size.