←Select platform

WiaScanningModeFlags Enumeration

Summary
Flags used within the WiaProperties structure.

Syntax
C#
C++/CLI
Python
[FlagsAttribute()] 
public enum WiaScanningModeFlags 
[FlagsAttribute()] 
public enum class WiaScanningModeFlags : public System.Enum, System.IComparable, System.IConvertible, System.IFormattable   
class WiaScanningModeFlags(Enum): 
   None = 0 
   Feeder = 1 
   Flatbed = 2 
   Duplex = 4 
   FrontFirst = 8 
   BackFirst = 16 
   FrontOnly = 32 
   BackOnly = 64 
   NextPage = 128 
   Prefeed = 256 
   AutoAdvance = 512 
   AdvancedDuplex = 1024 
Members
ValueMemberDescription
0x00000000NoneUse this value only to determine whether the WiaProperties structure is filled with a valid scanning mode.
0x00000001FeederScan using the document feeder.
0x00000002FlatbedScan using the flatbed.
0x00000004Duplex(0x00000400)Scan using duplexer operations.
0x00000008FrontFirstScan the front of the document first. This value is valid when Duplex is set.
0x00000010BackFirstScan the back of the document first. This value is valid when Duplex is set.
0x00000020FrontOnlyScan the front only. This value is valid when Duplex is set.
0x00000040BackOnlyScan the back only. This value is valid when Duplex is set.
0x00000080NextPageScan the next page of the document.
0x00000100PrefeedEnable pre-feed mode. Pre-position next document while scanning.
0x00000200AutoAdvanceEnables automatic feeding of the next document after a scan.
0x00000400AdvancedDuplexScan using individual settings configured for each child feeder item. Duplex and AdvancedDuplex cannot both be set.
Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Wia; 
 
 
WiaSession wiaSession; 
       
public void GetRootItemExample(IntPtr parent) 
{ 
   if (!WiaSession.IsAvailable(WiaVersion.Version1)) 
   { 
      Console.WriteLine("WIA version 1.0 not installed."); 
      return; 
   } 
   wiaSession = new WiaSession(); 
   wiaSession.Startup(WiaVersion.Version1); 
 
   DialogResult res = wiaSession.SelectDeviceDlg(parent, WiaDeviceType.Default, WiaSelectSourceFlags.NoDefault); 
   if (res != DialogResult.OK) 
   { 
      Console.WriteLine("Error selecting WIA device."); 
      wiaSession.Shutdown(); 
      return; 
   } 
 
   object rootItem = wiaSession.GetRootItem(null); 
   if (rootItem != null) 
   { 
      wiaSession.EnumItemsEvent += new EventHandler<WiaEnumItemsEventArgs>(wiaSession_EnumItemsEvent); 
 
      wiaSession.EnumChildItems(rootItem); 
 
      wiaSession.EnumItemsEvent -= new EventHandler<WiaEnumItemsEventArgs>(wiaSession_EnumItemsEvent); 
   } 
 
   wiaSession.Shutdown(); 
} 
 
void wiaSession_EnumItemsEvent(object sender, WiaEnumItemsEventArgs e) 
{ 
   if (e.Item != null) 
   { 
      WiaDataTransferProperties dataTransfer = WiaDataTransferProperties.Empty; 
      WiaImageEffectsProperties imageEffects = WiaImageEffectsProperties.Empty; 
 
      WiaProperties properties = wiaSession.GetProperties(e.Item); 
 
      dataTransfer.ImageDataType = WiaImageDataType.Grayscale; 
      imageEffects.Brightness = 250; 
 
      properties.DataTransfer = dataTransfer; 
      properties.ImageEffects = imageEffects; 
      properties.ScanningMode = WiaScanningModeFlags.Feeder;   // set scanning source to Feeder 
      properties.MaximumNumberOfPages = 0;                     // scan all pages in feeder 
      properties.ImageType = WiaImageType.Grayscale; 
      properties.Orientation = WiaOrientation.Portrait; 
 
      WiaImageResolutionProperties imageResolution = properties.ImageResolution; 
      imageResolution.BitsPerPixel = 8; 
      imageResolution.HorizontalResolution = 600; 
      imageResolution.VerticalResolution = 600; 
      properties.ImageResolution = imageResolution; 
 
      wiaSession.SetPropertiesEvent += new EventHandler<WiaSetPropertiesEventArgs>(wiaSession_SetPropertiesEvent); 
 
      wiaSession.SetProperties(e.Item, properties); 
 
      wiaSession.SetPropertiesEvent -= new EventHandler<WiaSetPropertiesEventArgs>(wiaSession_SetPropertiesEvent); 
 
      wiaSession.FreeItem(e.Item); 
   } 
} 
 
void wiaSession_SetPropertiesEvent(object sender, WiaSetPropertiesEventArgs e) 
{ 
   if (e.Error <= 0) 
   { 
      Console.WriteLine("Failed to set the below property:\n\tProperty Id: {0}\n\tProperty Value: {1}\n\tError: {2}\n\n", e.PropertyId.ToString(), e.Value.ToString(), e.Error.ToString()); 
   } 
} 
Requirements

Target Platforms

See Also

Reference

Leadtools.Wia Namespace

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

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