DataTransfer Property

Summary
Gets or sets data transfer properties for the current data source.
Syntax
C#
VB
C++
public TwainDataTransferProperties DataTransfer { get; set; } 
Public Property DataTransfer As TwainDataTransferProperties 
public: 
property TwainDataTransferProperties DataTransfer { 
   TwainDataTransferProperties get(); 
   void set (    TwainDataTransferProperties ); 
} 

Property Value

TwainDataTransferProperties structure contains Image effects data class.

Remarks

This property should be called after calling the get Properties property After you update this structure, you can update the TWAIN source by calling the set Properties property.

Example
C#
VB
using Leadtools; 
using Leadtools.Twain; 
 
public void DataTransferPropertyExample(IntPtr parent) 
{ 
   try 
   { 
      TwainSession session = new TwainSession(); 
      session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None); 
 
      TwainProperties props = session.Properties; 
      TwainDataTransferProperties dataTransfer = props.DataTransfer; 
 
      dataTransfer.FillOrder = TwainDataTransferFillOrder.LsbFirst; 
      dataTransfer.BufferedMemoryCompression = TwainCompressionMode.None; 
      dataTransfer.TransferMechanism = TwainTransferMechanism.Memory; 
      dataTransfer.ScanFileFormat = TwainFileFormat.Bmp; 
      dataTransfer.MemoryBufferSize = 1024; 
      dataTransfer.SaveToOneFile = true; 
      dataTransfer.AppendToFile = false; 
      dataTransfer.DumpMemoryBuffersToFile = true; 
      dataTransfer.FileName = Path.Combine(LEAD_VARS.ImagesDir, "test.bmp"); 
 
      props.DataTransfer = dataTransfer; 
      session.Properties = props; 
      session.Shutdown(); 
   } 
   catch (Exception ex) 
   { 
      MessageBox.Show(ex.Message); 
   } 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS21\Resources\Images"; 
} 
Imports Leadtools 
Imports Leadtools.Twain 
 
Public Sub DataTransferPropertyExample(ByVal parent As IntPtr) 
   Try 
      Dim session As TwainSession = New TwainSession() 
      session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None) 
 
      Dim props As TwainProperties = session.Properties 
      Dim dataTransfer As TwainDataTransferProperties = props.DataTransfer 
 
      dataTransfer.FillOrder = TwainDataTransferFillOrder.LsbFirst 
      dataTransfer.BufferedMemoryCompression = TwainCompressionMode.None 
      dataTransfer.TransferMechanism = TwainTransferMechanism.Memory 
      dataTransfer.ScanFileFormat = TwainFileFormat.Bmp 
      dataTransfer.MemoryBufferSize = 1024 
      dataTransfer.SaveToOneFile = True 
      dataTransfer.AppendToFile = False 
      dataTransfer.DumpMemoryBuffersToFile = True 
      dataTransfer.FileName = Path.Combine(LEAD_VARS.ImagesDir, "test.bmp") 
 
      props.DataTransfer = dataTransfer 
      session.Properties = props 
      session.Shutdown() 
   Catch ex As Exception 
      MessageBox.Show(ex.Message) 
   End Try 
End Sub 
 
Public NotInheritable Class LEAD_VARS 
   Public Const ImagesDir As String = "C:\LEADTOOLS21\Resources\Images" 
End Class 
Requirements

Target Platforms

Help Version 21.0.2021.6.30
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Twain Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.