Leadtools.Twain Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
TransferOptions Property
See Also  Example
Leadtools.Twain Namespace > TwainSession Class : TransferOptions Property



Gets and sets the options used for transferring data from the current TWAIN source.

Syntax

Visual Basic (Declaration) 
Public Property TransferOptions As TwainTransferOptions
Visual Basic (Usage)Copy Code
Dim instance As TwainSession
Dim value As TwainTransferOptions
 
instance.TransferOptions = value
 
value = instance.TransferOptions
C# 
public TwainTransferOptions TransferOptions {get; set;}
C++/CLI 
public:
property TwainTransferOptions TransferOptions {
   TwainTransferOptions get();
   void set (TwainTransferOptions value);
}

Return Value

Options to be used for transferring data from the current TWAIN source

Example

Visual BasicCopy Code
Public Sub TransferOptionsPropertyExample(ByVal parent As IWin32Window)
   Dim session As TwainSession = New TwainSession()
   session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None)

   Dim opts As TwainTransferOptions = session.TransferOptions

   opts.TransferMode = TwainTransferMode.File
      opts.FileName = LeadtoolsExamples.Common.ImagesPath.Path + "test.bmp"
   opts.FileFormat = RasterImageFormat.Bmp
   opts.CompressionMode = TwainCompressionMode.None

   session.TransferOptions = opts

   If session.IsTransferModeAvailable(TwainTransferMode.File) Then
      MessageBox.Show("File transfer is supported")
   End If

   If session.IsTransferModeAvailable(TwainTransferMode.Buffer) Then
      MessageBox.Show("Memory transfer is supported")
   End If

   If session.IsTransferModeAvailable(TwainTransferMode.Native) Then
      MessageBox.Show("Native transfer is supported")
   End If

   session.Shutdown()
End Sub
C#Copy Code
public void TransferOptionsPropertyExample(IWin32Window parent) 

   TwainSession session = new TwainSession(); 
   session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None); 
 
   TwainTransferOptions opts = session.TransferOptions; 
 
   opts.TransferMode = TwainTransferMode.File; 
   opts.FileName = LeadtoolsExamples.Common.ImagesPath.Path + "test.bmp"; 
   opts.FileFormat = RasterImageFormat.Bmp; 
   opts.CompressionMode = TwainCompressionMode.None; 
 
   session.TransferOptions = opts; 
 
   if (session.IsTransferModeAvailable(TwainTransferMode.File)) 
      MessageBox.Show("File transfer is supported"); 
 
   if (session.IsTransferModeAvailable(TwainTransferMode.Buffer)) 
      MessageBox.Show("Memory transfer is supported"); 
 
   if (session.IsTransferModeAvailable(TwainTransferMode.Native)) 
      MessageBox.Show("Native transfer is supported"); 
 
   session.Shutdown(); 
}

Remarks

Gets and sets transfer options to the selected Twain source.
Set the following properties before calling this method:
TransferMode Property
TwainTransferOptions.FileName Property
TwainTransferOptions.FileFormat Property
TwainTransferOptions.CompressionMode Property

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also