本文整理汇总了C#中IEngine.CreateScanManager方法的典型用法代码示例。如果您正苦于以下问题:C# IEngine.CreateScanManager方法的具体用法?C# IEngine.CreateScanManager怎么用?C# IEngine.CreateScanManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEngine
的用法示例。
在下文中一共展示了IEngine.CreateScanManager方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Scanning_with_FlexiCapture_Engine
// USE CASE: Scanning with ABBYY FlexiCapture Engine
public static void Scanning_with_FlexiCapture_Engine( IEngine engine )
{
// Create an instance of ScanManager
trace( "Create an instance of ScanManager..." );
IScanManager scanManager = engine.CreateScanManager();
// Enumerate scan sources
traceBegin( "Enumerate scan sources: " );
IStringsCollection sources = scanManager.ScanSources;
string sourcesList = "";
if( sources.Count > 0 ) {
for( int i = 0; i < sources.Count; i++ ) {
if( sourcesList.Length > 0 ) {
sourcesList += ", ";
}
sourcesList += '\'' + sources[i] + '\'';
}
} else {
sourcesList = "Not Found";
}
traceEnd( sourcesList );
// If at least one scan source found
if( sources.Count > 0 ) {
// In this sample we will be using the first found scan source
string scanSource = sources[0];
// You can optionally change the scan source settings or leave defaults
// trace( "Configure scan source " + '\'' + scanSource + '\'' );
// IScanSourceSettings sourceSettings = scanManager.get_ScanSourceSettings( scanSource );
// sourceSettings.PictureMode = ScanPictureModeEnum.SPM_Grayscale;
// scanManager.set_ScanSourceSettings( scanSource, sourceSettings );
// Prepare a directory to store scanned images
string scanFolder = SamplesFolder + "\\FCEScanning";
System.IO.Directory.CreateDirectory( scanFolder );
if( IsInteractive ) {
// If the scenario is being run in interactive mode you can try scanning by uncommenting the lines below
trace( "Scanning is disabled." );
// traceBegin( "Scanning... " );
// Get a single image from the scan source
// IStringsCollection imageFiles = scanManager.Scan( scanSource, scanFolder, false );
// assert( imageFiles.Count == 1 );
// assert( System.IO.File.Exists( imageFiles[0] ) );
// System.IO.File.Delete( imageFiles[0] );
// traceEnd( "OK" );
} else {
trace( "Running in non-interactive mode. Scanning skipped." );
}
}
}