←Select platform

WiaAcquireFlags Enumeration

Summary
Flags used with the WiaSession.Acquire, WiaSession.AcquireToFile and WiaSession.AcquireSimple methods.

Syntax
C#
C++/CLI
Python
[FlagsAttribute()] 
public enum WiaAcquireFlags 
[FlagsAttribute()] 
public enum class WiaAcquireFlags : public System.Enum, System.IComparable, System.IConvertible, System.IFormattable   
class WiaAcquireFlags(Enum): 
   None = 0 
   NoDefault = 1 
   SingleImage = 2 
   ShowUserInterface = 3 
   UseCommonUI = 4 
Members
ValueMemberDescription
0x00000000NoneDefault behavior for the device image acquisition dialog box.
0x00000001NoDefaultWIA_SELECT_DEVICE_NODEFAULT
0x00000002SingleImageWIA_DEVICE_DIALOG_SINGLE_IMAGE
0x00000003ShowUserInterfaceIf this flag is set then the image acquisition user interface dialog will be shown when call any of the available acquire functions, otherwise the user interface dialog will not be shown.
0x00000004UseCommonUIWIA_DEVICE_DIALOG_USE_COMMON_UI
Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Wia; 
 
 
      
public void IsAvailableExample(IntPtr parent) 
{ 
   if (!WiaSession.IsAvailable(WiaVersion.Version1)) 
   { 
      Console.WriteLine("WIA version 1.0 not installed."); 
      return; 
   } 
 
   WiaSession 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; 
   } 
 
   // Initialize and fill the required fields from the WiaAcquireOptions structure 
   WiaAcquireOptions wiaAcquireOptions = WiaAcquireOptions.Empty; 
   wiaAcquireOptions.MemoryBufferSize = 32 * 1024; 
   wiaAcquireOptions.DoubleBuffer = true; 
   wiaSession.AcquireOptions = wiaAcquireOptions; 
 
   wiaSession.AcquireEvent += new EventHandler<WiaAcquireEventArgs>(wiaSession_AcquireEvent); 
 
   wiaSession.Acquire(parent, null, WiaAcquireFlags.ShowUserInterface | WiaAcquireFlags.UseCommonUI); 
 
   wiaSession.AcquireEvent -= new EventHandler<WiaAcquireEventArgs>(wiaSession_AcquireEvent); 
   wiaSession.Shutdown(); 
} 
 
public void wiaSession_AcquireEvent(object sender, WiaAcquireEventArgs e) 
{ 
   Application.DoEvents(); 
 
   if ((e.Flags & WiaAcquiredPageFlags.StartOfPage) == WiaAcquiredPageFlags.StartOfPage) 
      Console.WriteLine("Beginning of data transfer."); 
   else if ((e.Flags & WiaAcquiredPageFlags.EndOfPage) == WiaAcquiredPageFlags.EndOfPage) 
      Console.WriteLine("End of data transfer."); 
 
   if (e.Image != null) 
   { 
      // You can load the image here. 
   } 
 
   e.Cancel = false; 
} 
Requirements

Target Platforms

See Also

Reference

Leadtools.Wia Namespace

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

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