←Select platform

Default Property

Summary
Returns a TwainFastConfiguration structure with default values.

Syntax
C#
C++/CLI
Python
public static TwainFastConfiguration Default { get; } 
public: 
static property TwainFastConfiguration Default { 
   TwainFastConfiguration get(); 
} 
Default # get  (TwainFastConfiguration) 

Property Value

A TwainFastConfiguration structure with default values.

Example
C#
using Leadtools; 
using Leadtools.Twain; 
 
 
public void twain_FastConfiguration(object sender, TwainFastConfigurationEventArgs e) 
{ 
   // ... set your code here 
   e.Stop = false; 
} 
 
public void FindFastConfigurationExample(IntPtr parent) 
{ 
   TwainSession session = new TwainSession(); 
   session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None); 
 
   session.EnableFastConfigurationEvent = true; 
   session.FastConfiguration += new EventHandler<TwainFastConfigurationEventArgs>(twain_FastConfiguration); 
 
   List<TwainFastConfiguration> twFastConfig = new List<TwainFastConfiguration>(); 
   TwainFastConfiguration tempFastConfig = new TwainFastConfiguration(); 
   tempFastConfig = TwainFastConfiguration.Default; 
 
   tempFastConfig.TransferMechanism = TwainTransferMode.File; 
   tempFastConfig.ImageFormat = Leadtools.RasterImageFormat.Bmp; 
   tempFastConfig.BitsPerPixel = 1; 
   twFastConfig.Add(tempFastConfig); 
 
   tempFastConfig.TransferMechanism = TwainTransferMode.File; 
   tempFastConfig.ImageFormat = Leadtools.RasterImageFormat.Tif; 
   tempFastConfig.BitsPerPixel = 1; 
   twFastConfig.Add(tempFastConfig); 
 
   TwainFindFastConfigurationResult fastConfigRes; 
 
   try 
   { 
      fastConfigRes = session.FindFastConfiguration(Path.Combine(LEAD_VARS.ImagesDir, ""), TwainFastUserInterfaceFlags.Show, 0, 1, twFastConfig); 
 
      string msg; 
      MessageBox.Show("FindFastConfig method was successful"); 
 
      msg = String.Format("Result Scan Configs count = {0}", fastConfigRes.Tested.Count); 
      MessageBox.Show(msg); 
 
      msg = String.Format("Transfer Mode = {0}\nFile Format = {1}\nBuffer Size = {2}\nRequired Time = {3}\n", 
         fastConfigRes.Tested[0].TransferMechanism, 
         fastConfigRes.Tested[0].ImageFormat, 
         fastConfigRes.Tested[0].BufferSize, 
         fastConfigRes.Tested[0].RequiredTime); 
      MessageBox.Show(msg, "Tested Scan Configurations..."); 
 
      msg = String.Format("Transfer Mode = {0}\nFile Format = {1}\nBuffer Size = {2}\nRequired Time = {3}\n", 
         fastConfigRes.Best.TransferMechanism, 
         fastConfigRes.Best.ImageFormat, 
         fastConfigRes.Best.BufferSize, 
         fastConfigRes.Best.RequiredTime); 
      MessageBox.Show(msg, "Best Scan Configurations..."); 
   } 
   catch (Exception ex) 
   { 
      MessageBox.Show(ex.Message); 
   } 
 
   session.Shutdown(); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Twain Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.