public TwainTransferOptions TransferOptions { get; set; }
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:\LEADTOOLS23\Resources\Images";
}