Leadtools.Twain Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.8.31
DataTransfer Property
See Also  Example
Leadtools.Twain Namespace > TwainProperties Structure : DataTransfer Property




Gets or sets data transfer properties for the current data source.

Syntax

Visual Basic (Declaration) 
Public Property DataTransfer As TwainDataTransferProperties
Visual Basic (Usage)Copy Code
Dim instance As TwainProperties
Dim value As TwainDataTransferProperties
 
instance.DataTransfer = value
 
value = instance.DataTransfer
C# 
public TwainDataTransferProperties DataTransfer {get; set;}
Managed Extensions for C++ 
public: __property TwainDataTransferProperties get_DataTransfer();
public: __property void set_DataTransfer( 
   TwainDataTransferProperties value
);
C++/CLI 
public:
property TwainDataTransferProperties DataTransfer {
   TwainDataTransferProperties get();
   void set (TwainDataTransferProperties value);
}

Return Value

TwainDataTransferProperties structure contains Image effects data class.

Example

Visual BasicCopy Code
Public Sub DataTransferPropertyExample(ByVal parent As IWin32Window)
   Try
      Dim twainSession As TwainSession = New TwainSession()
      twainSession.Startup(parent, "LEAD Technologies, Inc.", "LEAD Twain .NET", "Version 14", "LEADTools Twain test sample", TwainStartupFlags.None)

      Dim props As TwainProperties = twainSession.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 = "c:\test.bmp"

      props.DataTransfer = dataTransfer
      twainSession.Properties = props
      twainSession.Shutdown()
   Catch ex As Exception
      MessageBox.Show(ex.Message)
   End Try
End Sub
C#Copy Code
public void DataTransferPropertyExample(IWin32Window parent) 

   try 
   { 
      TwainSession twainSession = new TwainSession(); 
      twainSession.Startup(parent, "LEAD Technologies, Inc.", "LEAD Twain .NET", "Version 14", "LEADTools Twain test sample", TwainStartupFlags.None); 
 
      TwainProperties props = twainSession.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 = @"c:\test.bmp"; 
 
      props.DataTransfer = dataTransfer; 
      twainSession.Properties = props; 
      twainSession.Shutdown(); 
   } 
   catch (Exception ex) 
   { 
      MessageBox.Show(ex.Message); 
   } 
}

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.

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