# $ K Wang Image Scan Control
Properties   Methods   Events
Wang’s Image Scan control adds scanning capabilities to applications that support 32-bit OLE controls. The Scan control is invisible and can work independently of other controls. To display images while they are being scanned, you can link the Scan control to the Wang Image Edit control.
The Image Scan control supports TWAIN-compatible scanners. For a list of scanners that have been certified with Imaging software, refer to the README.DOC file included with your Wang software or contact the manufacturer of your scanner.
Your scanner will require a TWAIN data source (usually supplied by the manufacturer) and the latest version of the TWAIN DLLs. You can obtain the latest 32-bit TWAIN DLLs from the following sources:
World Wide Web -- At http://www.twain.org
FTP -- At ftp.twain.org

Notes: After installing the latest TWAIN DLLs, you may experience compatibility problems with some applications.
Some scanners may have been sold with data sources that are not compatible with your current operating system. Please contact the manufacturer of your scanner for the latest data sources and compatibility information.
The ShowScannerSetup method is no longer supported. Refer to the StartScan method, which can be used with the ShowSetupBeforeScan property to provide the same function.
See Also
Imaging Concepts

# $ K Properties (Scan control)
CompressionInfo	PageOption	
CompressionType	PageType	
DestImageControl	ScanTo	
FileType	Scroll	
Image	ShowSetupBeforeScan	
MultiPage	StatusCode	
Page	StopScanBox	
PageCount	Zoom	

# $ K CompressionInfo Property
Sets the compression options to use when scanning.
Applies To
Image Scan control
Syntax
object.CompressionInfo[=value]
Data Type
Long 
Setting	Description	
Note:  Settings 1 to 32 cannot be used with JPEG compression.	
1	EOL -- include or expect standard end of line bit sequences	
2	Packed lines -- data is not byte aligned	
4	Prefixed EOLs -- include or expect prefixed end of line bit sequences	
8	Compressed bit order, left to right 	
16 (default)	Expanded bit order, left to right	
32	Negate -- reverses black and white on expansion	
Note:  The following settings pertain only to JPEG compression.	
64	High compression, high quality	
128	High compression, medium quality	
256	High compression, low quality	
512	Medium compression, high quality	
1024	Medium compression, medium quality	
2048	Medium compression, low quality	
4096	Low compression, high quality	
8192	Low compression, medium quality	
16384	Low compression, low quality	
Remarks
Using the JPEG compression method, the higher the compression ratio, the more degraded the image quality becomes. The amount of degradation that is acceptable varies with the image and the application. Experimenting with different settings is recommended.
Resolution is independent of the compression ratio. Optimal settings will vary, based on individual requirements.
Be careful when changing these values -- the compression type could be affected.
See Also
Compression Options
FileType property
PageType property
CompressionType property
Zoom property

# $ K CompressionType Property
Sets the compression type to use when scanning.
Applies To
Image Scan control
Syntax
object.CompressionType[=value]
Data Type
Integer (enumerated)
Setting	Description	
1	No compression	
2	Group 3 1D FAX	
3 (default)	Group 3 1D Modified Huffman	
4	Packed Bits	
5	Group 4 2D FAX	
6	JPEG	
Remarks
The value set for this property determines which settings are available in the CompressionInfo property.
See Also
Compression types
FileType property
PageType property
CompressionInfo property
Zoom property

# $ K DestImageControl Property
Returns or sets the name of the destination image / edit control.
Applies To
Image Scan control
Syntax
object.DestImageControl[=controlname]
Data Type
String 
Remarks
This property links the Image Scan control to a specified Wang ImageEdit control, letting you see the image that is scanned.
Use the name of the ImageEdit control to which you want to link.
See Also
ImageControl property  (Wang ImageEdit control)

# $ K FileType Property 
Returns or sets the type of image file that will be created.
Applies To
Image Scan control
Syntax
object.FileType[=value]
Data Type
Integer (enumerated)
Setting	Description	
1  (default)	TIFF	
2	not used	
3	BMP	
Remarks
Set to the file type you want to create.
See Also
File types
PageType property
CompressionType property
CompressionInfo property
Zoom property 

# $ K Image Property
Returns or sets the name of the object to which you are scanning.
Applies To
Image Scan control
Syntax
object.Image[=filename]
Data Type
String 
Remarks
This property is not the same as, or linked to, the Image properties used by the Wang ImageEdit or Thumbnail controls.
You can point to a file template, and have image files generated and incremented as you scan to them. For example, if you use a template named ‘img’, you must specify a path, such as c:\scan\images\img. The template ‘img’ will generate files named img00000.xxx, img00001.xxx, img00002.xxx, and so on. This cannot be used if you Scan to display using the DestImageControl property in conjunction with the Wang Image Edit control.
See Also
Images
DestImageControl property

# $ K MultiPage Property
Returns or sets if one or more image pages will be scanned to an image file.
Applies To
Image Scan control
Syntax
object.MultiPage[= {True|False}]
Data Type
Boolean
Setting	Description	
True	Scans multiple image pages to an image file.	
False  (default)	Scans a single image page to an image file.	
Remarks
This property is generally used with scanners that have an automatic document feeder (ADF), and you are scanning multiple documents to a template.
See Also
Image page

# $ K Page Property
Returns or sets the starting page for a scanning session.
Applies To
Image Scan control
Syntax
object.Page[=pagenumber]
Data Type
Long
Remarks
Set this property to the current page number.
To append to a file, set the page number to 0 (zero).
To insert one or more page, set the page number to the number of the page you are inserting before, less 1. For example, to insert before page 5, enter page number 4.
See Also
Image page

# $ K PageCount Property
Returns or sets the number of pages per image file.
Applies To
Image Scan control
Syntax
object.PageCount[=pagenumber]
Data Type
Long
Remarks
This property is generally used with scanners that have an automatic document feeder (ADF), and you are scanning multiple documents to a template.
Set this property to the page count of fixed length files. You must also specify the path to the template (for example c:\scan\images\img, where the Template name is img).
If the MultiPage property is set to False, then PageCount images are scanned with the same number of image files.
See Also
Image page
MultiPage property

# $ K PageOption Property
Indicates or sets if a scanned page will be Appended or Inserted, or if a page will be overwritten with or without a prompt at scan time.
Applies To
Image Scan control
Syntax
object.PageOption[=value]
Data Type
Integer (enumerated)
Setting	Description	
0	Creates a new image file and adds image pages. An error will occur if the file exists. Pages can be added only if an automatic document feeder (ADF) is present.	
1  (default)	Creates a new image file and adds image pages. If an image file exists, a prompt is displayed before overwriting. Pages can be added only if an automatic document feeder (ADF) is present.	
2	Appends to an existing image file.	
3	Inserts a page in the existing image file, before the current image page, as specified in the Page property. An error will occur if the file does not exist.	
4	Overwrites an image file on an existing image page. If the image page does not exist, an error will occur.	
5	Displays a prompt prior to overwriting an existing image page. If the image page does not exist, an error will occur.	
6	Overwrites all pages in an image file.	
Remarks
The Page property determines the current image page in a selected file.
If settings 0, 1, 2, or 6 are chosen, a new file is created if the file specified in the Image property does not exist.
See Also
Page property
Image property

# $ K PageType Property
Returns or sets the image type for the pages being saved after scanning.
Applies To
Image Scan control
Syntax
object.PageType[=value]
Data Type
Integer (enumerated)
Setting	Description	
1  (default)	Black and white	
2	Gray scale, 4-bit	
3	Gray scale, 8-bit	
4	Palettized, 4-bit (BMP only)	
5	Palettized, 8-bit (TIFF only)	
6	RGB, 24-bit	
7	BGR, 24-bit	
Remarks
This property also determines the compression type and compression information required for saving the image file.
See Also
Image Types
FileType property
CompressionType property
CompressionInfo property
Zoom property

# $ K ScanTo Property
Returns or sets the destination of the image being scanned.
Applies To
Image Scan control
Syntax
object.ScanTo[=value]
Data Type
Integer (enumerated)
Setting	Description	
0  (default)	Display the scanned image.	
1	Display the scanned image and write it to a file.	
2	Write the scanned image to a file.	
3	Write the scanned image to a file using a template, and display the image.	
4	Write the scanned image to a file using a template.	
5	Fax the scanned image.	
Remarks
Images scanned to display must be saved in the Wang ImageEdit control.
Ensure that the ImageEdit control’s Image property is set correctly.
See Also
Image property, Wang ImageEdit control
MultiPage property
PageCount property

# $ K Scroll Property
Sets or indicates if a displayed image will be scrolled while it is being scanned.
Applies To
Image Scan control
Syntax
object.Scroll[={True|False}]
Data Type
Boolean
Setting	Description	
True (default)	Scanned image is scrolled.	
False	Scanned image is not scrolled.	
Remarks
Used in conjunction with the ScanTo property if ScanTo is set to a value of 0, 1, or 3.
See Also
ScanTo property

# $ K ShowSetupBeforeScan Property
Displays the Setup dialog box before starting a scan.
Applies To
Image Scan control
Syntax
object.ShowSetupBeforeScan[={True|False}]
Data Type
Boolean
Setting	Description	
True (default)	Displays the Setup dialog box before scanning.	
False	Does not display the Setup dialog box before scanning.	
Remarks
Used to set up the scanner before the first scan, and then bypass the setup dialog box for subsequent scans.
Some TWAIN scanner data sources require the Setup dialog be displayed before each scan, because the settings from the previous scan are not saved.

# $ K StopScanBox Property
Sets or indicates if a dialog box from which you can stop the scanning session will be displayed.
Applies To
Image Scan control
Syntax
object.StopScanBox[={True|False}]
Data Type
Boolean
Setting	Description	
True	Displays the Stop Scan dialog box.	
False  (default)	Does not display the Stop Scan dialog box.	

# $ K Zoom Property
Returns or sets the scale at which scanned pages are displayed. 
Applies To
Image Scan control
Syntax
object.Zoom[=value]
Data Type
Long
Remarks
Used in conjunction with the ScanTo property if ScanTo is set to a value of 0, 1, or 3.
At scan time, the zoom value set is rounded to one of the following values: 6.25%, 12.5%, 25%, 50%, 100%, 200%, 400%, or 800%.
See Also
ScanTo property

# $ K Methods (Scan control)
AboutBox	ShowSelectScanner	
CloseScanner	StartScan	
OpenScanner	ShowScanNew	
ResetScanner	ShowScanPage	
ScannerAvailable	ShowScanPreferences	
ShowScannerSetup	StopScan	

# $ K CloseScanner Method
Closes the scanner by unloading the driver.
Applies To
Image Scan control
Syntax
object.CloseScanner
Arguments
None
Return Value
Long
Most errors need to be intercepted by Catch ( ) in C++ or by On Error... in Visual Basic.	
A busy condition returns an informational message.	
Remarks
When a scanner or application error occurs, close the scanner before you access it again to avoid possible problems.
See Also
OpenScanner method

# $ K OpenScanner Method
Opens the scanner by loading the driver.
Applies To
Image Scan control
Syntax
object.OpenScanner
Arguments
None
Return Value
Long
Most errors need to be intercepted by Catch ( ) in C++ or by On Error... in Visual Basic.	
A busy condition returns an informational message.	
Remarks
After successfully opening a scanner with this call, you should call the CloseScanner method. This frees up the scanner so that .dlls and executable files can be unloaded.
See Also
CloseScanner method

# $ K ResetScanner Method
Resets the scanner hardware and software.
Applies To
Image Scan control
Syntax
object.ResetScanner
Arguments
None
Return Value
Long
Most errors need to be intercepted by Catch ( ) in C++ or by On Error... in Visual Basic.	
A busy condition returns an informational message.	

# $ K ScannerAvailable Method
Checks to see if any TWAIN-compatible software is available.
Applies To
Image Scan control
Syntax
object.ScannerAvailable
Return Value
Boolean
Setting	Description	
True	Support for a TWAIN-compliant scanner is available.	
False	Support for a TWAIN-compliant scanner is not available.	
Remarks
This is done by checking the software (drivers and .dlls), not the hardware. 
See Also
ShowScannerSetup method

# $ K ShowScannerSetup Method
Displays the setup dialog box provided by the TWAIN scanner driver.
NOTE: This method is not supported in this release, and calling it will return an error.  The recommended way to setup a scanner is:
	Use the StartScan method with the ShowSetupBeforeScan property.
	Set the ShowSetupBeforeScan property to TRUE.
Applies To
Image Scan control
Syntax
object.ShowScannerSetup
Arguments
None
Return Value
Long
Most errors need to be intercepted by Catch ( ) in C++ or by On Error... in Visual Basic.	
A busy condition returns an informational message.	
Remarks
The dialog box and selectable options are provided by the library twain.dll.

# $ K ShowSelectScanner Method
Select the TWAIN scanner you want to use.
Applies To
Image Scan control
Syntax
object.ShowSelectScanner
Arguments
None
Return Value
Long
Most errors need to be intercepted by Catch ( ) in C++ or by On Error... in Visual Basic.	
A busy condition or cancel returns an informational message.	
Remarks
Displays a dialog box that shows the installed TWAIN scanners.
See Also
ScannerAvailable method

# $ K StartScan Method
Starts the scanning process.
Applies To
Image Scan control
Syntax
object.StartScan
Arguments
None
Return Value
Long
Most errors need to be intercepted by Catch ( ) in C++ or by On Error... in Visual Basic.	
A busy condition or cancel returns an informational message.	
Remarks
If the scanner is closed, it will be opened.
See Also
Image property
PageOption property
ScanTo property
MultiPage property
FileType property

# $ K ShowScanNew Method
Displays the Scan New dialog box from which you can change options and scan.
Applies To
Image Scan control
Syntax
object.ShowScanNew[={True|False}]  
Arguments
Boolean (optional)
Variant
Setting	Description	
True (default)	Modal dialog.	
False	Modeless dialog.	
Return Value
Long
Most errors need to be intercepted by Catch ( ) in C++ or by On Error... in Visual Basic.	
A busy condition or cancel returns an informational message.	
Remarks
Provides an interactive method to change scanning options before starting a session.
The scanner will be opened if it is not already.

# $ K ShowScanPage Method
Displays the Scan Page dialog box from which you can change options and scan.
Applies To
Image Scan control
Syntax
object.ShowScanPage[={True|False}]
Arguments
Boolean (optional)
Variant
Setting	Description	
True (default)	Modal dialog.	
False	Modeless dialog.	
Return Value
Long
Most errors need to be intercepted by Catch ( ) in C++ or by On Error... in Visual Basic.	
A busy condition or cancel returns an informational message.	
Remarks
This method is used to Insert, Append, or Overwrite pages in an existing image file while scanning.

# $ K ShowScanPreferences Method
Sets preferences for scanning.
Applies To
Image Scan control
Syntax
object.ShowScanPreferences
Arguments
None
Return Value
Long
Most errors need to be intercepted by Catch ( ) in C++ or by On Error... in Visual Basic.	
A busy condition returns an informational message.	
Remarks
Displays a dialog box with a list of available options.
You can create a custom option that displays a dialog box with a detailed list of preferences.

# $ K StopScan Method
The scanning operation is halted.
Applies To
Image Scan control
Syntax
object.StopScan
Arguments
None
Return Value
Long
Most errors need to be intercepted by Catch ( ) in C++ or by On Error... in Visual Basic.	
A busy condition returns an informational message.	
Remarks
The scan operation will stop on the page that is currently being scanned. Cleanup, including clearing paper and buffers, will be performed.

# $ K Events (Scan control)
The Scanner control uses the following custom Events:
PageDone
ScanDone
ScanStarted

A standard Event, Error, is used for fired errors.

# $ K PageDone Event
Signals the completion of each scanned page. 
Applies To
Image Scan control
Syntax
object_PageDone
Remarks
This event is triggered after a page is scanned.
Return Value
Long
Passes the Number of the page scanned.	

# $ K ScanDone Event
Signals the end of a scanning operation.
Applies To
Image Scan control
Syntax
object_ScanDone
Remarks
This event is triggered immediately after a scanning operation is completed.

# $ K ScanStarted Event
Signals the start of a scanning operation.
Applies To
Image Scan control
Syntax
object_ScanStarted
Remarks
This event is triggered just before scanning starts.