Gets and sets the options used for transferring data from the current TWAIN source.
public TwainTransferOptions TransferOptions { get; set; }
Public Property TransferOptions As TwainTransferOptions
public:
property TwainTransferOptions TransferOptions {
TwainTransferOptions get();
void set ( TwainTransferOptions );
}
Options to be used for transferring data from the current TWAIN source
Gets and sets transfer options to the selected TWAIN source. Set the following properties before calling this method: TransferMode Property FileName Property FileFormat Property CompressionMode Property
using Leadtools;
using Leadtools.Twain;
public void TransferOptionsPropertyExample(IntPtr parent)
{
TwainSession session = new TwainSession();
session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None);
TwainTransferOptions opts = session.TransferOptions;
opts.TransferMode = TwainTransferMode.File;
opts.FileName = Path.Combine(LEAD_VARS.ImagesDir, "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();
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
}
Imports Leadtools
Imports Leadtools.Twain
Public Sub TransferOptionsPropertyExample(ByVal parent As IntPtr)
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 = Path.Combine(LEAD_VARS.ImagesDir, "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
Public NotInheritable Class LEAD_VARS
Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"
End Class
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document