←Select platform

AcquireOptions Property

Summary
Gets or sets some memory and file transfer options that affect the acquisition process from the current WIA source.

Syntax
C#
C++/CLI
Python
public WiaAcquireOptions AcquireOptions { get; set; } 
public: 
property WiaAcquireOptions AcquireOptions { 
   WiaAcquireOptions get(); 
   void set (    WiaAcquireOptions ); 
} 
AcquireOptions # get and set (WiaSession) 

Property Value

Memory and file transfer options that affect the acquisition process from the current WIA source.

Remarks

Use the WiaAcquireOptions property to get or set options related to the memory and file transfer modes like transfer buffer size, enabling/disabling the double buffering feature (for memory mode), destination filename, etc.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Wia; 
 
 
       
public void AcquireToFileExample(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.FileName = Path.Combine(LEAD_VARS.ImagesDir, "WiaTest.bmp"); 
   wiaAcquireOptions.OverwriteExisting = true; 
   wiaAcquireOptions.Append = false; 
   wiaAcquireOptions.SaveToOneFile = false; 
   wiaSession.AcquireOptions = wiaAcquireOptions; 
 
   wiaSession.AcquireFileEvent += new EventHandler<WiaAcquireFileEventArgs>(wiaSession_AcquireFileEvent); 
 
   wiaSession.AcquireToFile(parent, null, WiaAcquireFlags.ShowUserInterface | WiaAcquireFlags.UseCommonUI); 
 
   // Display a listing of all paths and filenames for the saved files(s). 
   if (wiaSession.FilesCount > 0) 
   { 
      string strMsg = "Acquired page(s) were saved to:\n\n"; 
      for (int i = 0; i < wiaSession.FilesCount; i++) 
      { 
         string strTemp = string.Format("{0}\n", wiaSession.FilesPaths[i]); 
         strMsg += strTemp; 
      } 
      Console.WriteLine(strMsg); 
   } 
 
   wiaSession.AcquireFileEvent -= new EventHandler<WiaAcquireFileEventArgs>(wiaSession_AcquireFileEvent); 
   wiaSession.Shutdown(); 
} 
 
public void wiaSession_AcquireFileEvent(object sender, WiaAcquireFileEventArgs e) 
{ 
   Console.WriteLine(e.Percent); 
} 
 
 
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.Wia Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.