Leadtools.Twain Namespace > TwainSession Class : TransferOptions Property |
public TwainTransferOptions TransferOptions {get; set;}
'Declaration Public Property TransferOptions As TwainTransferOptions
'Usage Dim instance As TwainSession Dim value As TwainTransferOptions instance.TransferOptions = value value = instance.TransferOptions
public TwainTransferOptions TransferOptions {get; set;}
get_TransferOptions();
set_TransferOptions(value);
public: property TwainTransferOptions TransferOptions { TwainTransferOptions get(); void set ( TwainTransferOptions value); }
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 = 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
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 = 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"; }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
TwainSession Class
TwainSession Members
Startup Method
Shutdown Method
Acquire Method
MaximumTransferCount Property
DuplexScanningMode Property
EnableDuplexScanning Property
AcquirePageOptions Property
ImageEffects Property
ImageBitsPerPixel Property
ImageUnit Property
ImageFrame Property
IsTransferModeAvailable Method
ShowProgressIndicator Method