ImageGear Professional DLL v17.1 for Windows Accusoft
Simplifying the Scanning Application
Send Feedback  
ImageGear Professional DLL v17.1 for Windows > User Guide > Using ImageGear > Scanning Images > Scanning Images Using the ISIS Interface > Simplifying the Scanning Application

Glossary Item Box

Now that you have seen how to individually load, initialize, and link drivers, there is a simpler way that can often be used to make the toolkit do much of this work for you: IG_ISIS_drv_load_init_pipe(). Here are the steps involved in writing the same scanning application using IG_ISIS_drv_load_init_pipe():

  1. Load, initialize, and link the scanner driver and the file writing driver:
      Copy Code
    IG_ISIS_drv_load_init_pipe (0, "SPEW|PIXFPACK", &hScan, 0);
    
  2. Set tags on the pipe to specify the filename, file type, and how to write the file:
      Copy Code
    IG_ISIS_tag_set_ascii(hScan, IG_ISIS_TAG_OUTPUTNAME, (char FAR *)"TEST.TIF");
    IG_ISIS_tag_set_long(hScan, IG_ISIS_TAG_FILETYPE, 0, IG_ISIS_FILETYPE_TIFF);
    

    This step is the same as before, except the tags are set on the scanner driver because there is no handle to the file writing driver. (ISIS propagates all tags to every driver in the pipe, so this is not a problem). If you need access to a particular driver's handle, that driver must be loaded, initialized, and linked separately.

  3. Invoke the pipe:
      Copy Code
    IG_ISIS_run_zone (hScan, Buffer, BUFSIZE);
    

    This step is the same as before.

  4. Unlink and unload the drivers when you are done with them:
      Copy Code
    IG_ISIS_drv_unload_pipe (hScan);
    

    This single function unloads the entire pipe. If you loaded and linked any drivers using separate functions, they also will be unlinked and unloaded by the call to IG_ISIS_drv_unload_pipe() .

Example:

Here is the complete simplified code to scan a page to a file:

  Copy Code
#define BUFSIZE 8192
{
char Buffer[BUFSIZE];
HISISDRV hScan;
 
/* Load and initialize the pipe */
IG_ISIS_drv_load_init_pipe(0, "SPEW|PIXFPACK", &hScan, 0);
 
/* Set tags to correctly write the file */
IG_ISIS_tag_set_ascii(hScan, IG_ISIS_TAG_OUTPUTNAME, (char FAR *)"TEST.TIF");
IG_ISIS_tag_set_long(hScan, IG_ISIS_TAG_FILETYPE, 0, IG_ISIS_FILETYPE_TIFF);
 
/* Invoke the pipe and scan the page */
IG_ISIS_run_zone(hScan, Buffer, BUFSIZE);
 
/* Unlink and unload the drivers */
IG_ISIS_drv_unload_pipe(hScan);
}
©2012. Accusoft Corporation. All Rights Reserved.