The solution program has full control on all aspects of the capture process – clip definition/storage, timing, organization, transformation and destination.
Your solution uses the IClipHelper interface to capture clips off the current sheet during scanning events. The ScanEventArgs.ClipHelper property is the programmatic hub for capture related operations. Note that exactly one clip is appended to the specified clip destination per call to a capture method.
- If not, go to step 2.
- If yes, use one of the WriteClipToFile overloads per the following table:
If you want to capture a … | You must specify the region of interest… | And invoke … |
full page image in the simplest way | as the desired side of the sheet | WriteClipToFile4 |
region of the form in the simplest way | as discrete arguments | WriteClipToFile3 |
region of the form (or full page) and return the adjusted coordinates | populate a ClipRegion structure | WriteClipToFile |
region of the form in the most flexible way | populate a ClipAttributes structure | WriteClipToFile2 |
- If not, go to step 4.
- If yes, use one of the GetClipAsStream overloads per the following table:
If you want to capture a … | You must specify the region of interest… | Use … |
full page image in the simplest way | as the desired side of the sheet | WriteClipToStream4 |
region of the form in the simplest way | as discrete arguments | WriteClipToStream3 |
region of the form (or full page) and return the adjusted coordinates | populate a ClipRegion structure | WriteClipToStream |
region of the form in the most flexible way | populate a ClipAttributes structure | WriteClipToStream2 |
- If not, go to step 2.
- If yes, use one of the WriteClipToFile overloads per the following table:
If you want to capture a … | You must specify the region of interest… | Use … |
full page image in the simplest way | as the desired side of the sheet | GetClipAsStream4 |
region of the form | as discrete arguments | GetClipAsStream3 |
region of the form (or full page) and return the adjusted coordinates | populate a ClipRegion structure | GetClipAsStream |
region of the form in the most flexible way | populate a ClipAttributes structure | GetClipAsStream2 |
- If not, go to step 5.
- If yes, use one of the GetClip overloads per the following table:
If you want to capture a … | You must specify the region of interest… | Use … |
full page image in the simplest way | as the desired side of the sheet | GetClipAsStream4 |
region of the form in the simplest way | as discrete arguments | GetClipAsStream3 |
region of the form (or full page) and return the adjusted coordinates | populate a ClipRegion structure | GetClipAsStream |
region of the form in the most flexible way | populate a ClipAttributes structure | GetClipAsStream2 |
- If not, go to step 2.
- If yes, use one of the WriteClipToFile overloads per the following table:
If you want to capture a … | You must specify the region of interest… | Use … |
full page image in the simplest way | as the desired side of the sheet | GetClip5 |
region of the form in the simplest way | as discrete arguments | GetClip3 |
region of the form in the simplest way and return the adjusted coordinates | as discrete IN/OUT arguments | GetClip4 |
region of the form (or full page) and return the adjusted coordinates | populate a ClipRegion structure | GetClip |
region of the form in the most flexible way | populate a ClipAttributes structure | GetClip2 |
Create and populate a ClipRegion or ClipAttributes structure to specify the clip. This process accomplishes the same results as using the Clip Attributes dialog in the ScanTools Plus application. Scripting clients that do not have the concept of a structure may find it difficult or unable to use either the ClipRegion or ClipAttribute based methods.
Use ClipRegion-based methods if you do not intend to deviate from the sheet-level application definition settings i.e. all clips for a sheet share the same attributes as the sheet. You will typically use ClipRegion if the only clip attributes that vary for your situation is the clip location and size.
Declare a ClipRegion structure
Populate the structure using location and size known to you. To obtain a full page image, only specify the side; set all other members to 0. The capture method will populate these members upon return.
Use ClipAttributes-based methods if you have set different attributes for different clips within the application definition and want to reuse these settings instead of the sheet-level settings. Methods that take the ClipAttributes structure as an input overwrite these properties and these values stay in effect until another such call or the next FormIdentified event. It is also possible to directly write to these properties.
After you decide to use ClipAttributes, at least two choices follow: load settings from the Data Services CLIPS schema rowset or create a new set of values. Another variation is where you load from the CLIPS schema rowset but override a value or two say CombineWithForm.
Declare a ClipAttributes structure
CAUTION: Specify -1 or 0 for the members BitoneEdgeContrastEnhancement and EnableBackgroundOffset. These members are Booleans in spirit but unfortunately .Net marshals these as System.Int16.
For .Net code, see the handler for the ScanningManager’s Clip event in the Scanning Sample - .NET.
NOTE:For languages that can not handle a structure, ClipHelper also has the following methods available that provide the same functionality as the ClipAttributes structure:
Typically your clips are defined in the ScanTools Plus application and thus reside in the .StxAppDef file. However, you can choose to define and store the metadata in an XML file or database as you like. This is possible because the storage and input of metadata are decoupled from each other. Metadata is presented to the IClipHelper clip capture methods at scan-time.
Use the CLIPS schema rowset to retrieve clip metadata from the application definition file. Create and populate a ClipAttributes structure with this information. You may choose to modify this information as needed before presentation to the IClipHelper clip capture methods.
In principle, clips may be captured at any of the following events although we recommend using only the Clip event:
You organize your clips the way you want – one file per document, one file per clip. Additionally, file names are specified by the solution program. Recall that the traditional ScanTools Plus capture method limits you to one file (master TIFF file) for the entire batch.
Single frame and multi-frame TIFF layouts are possible.
To build a single frame image, ensure that the stream you pass in is empty to begin with. Or call the GetClipAsStream or GetClipAsStream2 methods which will create new streams.
To build a multi-frame image, pass an empty stream when the capture of the first clip. To capture subsequent clips, pass the same stream without disturbing the stream pointer or contents.
The IClipHelper interface offsers a greater choice of clip destinations than the traditional ScanTools Plus method. Primary destinations are IClip objects, unmanaged binary streams (IStream) and disk files. Final destinations obviously depend upon your solution needs and can include database columns, optical storage media and so on.
For maximum flexibility, we recommend capturing to IClip objects. These objects make available the clip image as a standard OLE Picture object as well as support saving the clip to a stream or file. Upon acquisition, IClip objects can outlive the scanning session and their object lifetime is entirely controlled by the solution.
Transformation means combining with the form background image and rotating the image from the scanned orientation. Tranformation is processor intensive and affects scanner and image transfer thruput. It also increases database/disk space requirements. It is usually best to transform as late as possible for example just before displaying the clip to an operator.
If you decide to transform while scanning, you can use one of these IClipHelper methods to capture the clip:
Desired Destination | Using ClipRegion | Using ClipAttributes |
---|---|---|
Stream specified by solution | ||
Stream created by Link and handed off to solution | ||
File |
If you decide to defer the transformation, use one of these IClipHelper methods to capture the clip:
Desired Destination | Using ClipRegion | Using ClipAttributes |
---|---|---|
IClip object |
When you are ready to save the clip, use the following code snippet:
IClip.TransformOnWrite=false
IClip.WriteToStream (or IClip.WriteToFile)
See Help on Help for additional information on using this help file. See Scantron Technical Support for additional information on technical support and training options. See the ScanTools Suite System Requirements for further details on hardware and software requirements. ScanTools is a suite of products; the specific information you want may appear in the help for a different module. If you don't find what you're looking for here, try one of the following:
| Scantron Corporation Customer Service (forms, products, and services): 1-800-SCANTRON (722-6876) Technical Support: 1-800-445-3141 | |
Copyright © 1998-2012 Scantron Corporation. All rights reserved. Use permitted only under license. www.scantron.com. No part of the Help or user guides may be reproduced in any form, or by any means, without express permission from Scantron Corporation. LINKS TO THIRD PARTY SITES This help system may contain links to third party websites ("Linked Sites"). The Linked Sites are not under the control of Scantron and Scantron is not responsible for the content of any Linked Site, including without limitation any link contained in a Linked Site or any changes or modifications to a Linked Site. Scantron is not responsible for web casting or any other form of transmission received from any Linked Site. Scantron provides Users with the ability to link the Assessment System to the Linked Sites as a convenience to you, and the inclusion of any link does not imply endorsement by Scantron of the Linked Site or any association with its operators. |