Gets or sets data transfer properties for the current data source.
Syntax
Return Value
TwainDataTransferProperties structure contains Image effects data class.
Example
Visual Basic | Copy Code |
---|
Public Sub DataTransferPropertyExample(ByVal parent As IWin32Window)
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 = LeadtoolsExamples.Common.ImagesPath.Path + "test.bmp"
props.DataTransfer = dataTransfer
session.Properties = props
session.Shutdown()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub |
C# | Copy Code |
---|
public void DataTransferPropertyExample(IWin32Window 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 = LeadtoolsExamples.Common.ImagesPath.Path + "test.bmp"; props.DataTransfer = dataTransfer; session.Properties = props; session.Shutdown(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } |
Remarks
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