ImageMan ActiveX
Scanning

Once any capabilities have been set, calling the ScanPage method will initiate the scanning process. The ScanPage method should be called for each page to be scanned and returns a handle to a DIB (Device Independent Bitmap) which contains the page image data. If no more pages are available to be scanned then ScanPage will return a NULL handle. Use the MaxPages property to specify the maximum number of pages you would like to scan.

 

When the application has finished calling the ScanPage method it should call the CloseSource method to close the scanner and allow it to be used by other applications.

 

' Set the Maximum # of pages to be scanned

ImTwain1.MaxPages = 10

 

' Time to set any Capabilities we want to change

' Set the Brightness to +500

ImTwain1.NegotiateCapability(ImTwain80.Capabilities.Brightness, 500)

 

do

hDIB = ImTwain1.ScanPage(False)   ' Dont display the scanner dialog

if hDIB <> 0 Then

' Store off the hDIB to the Image Control and save it to a tiff file

ImageControl1.hDIB = hDIB

ImageControl1.SaveAs "c:\out.tif"

End if

while hDIB <> 0

 

'  Close the source so its available to other applications

ImTwain1.CloseSource

 

 

 


© 2014 Data Techniques, Inc. All rights reserved.

Submit feedback on this topic