Leadtools TWAIN(Leadtools.Twainアセンブリ)

フレームを表示

DataTransferプロパティ






現在のデータ送信側のためにデータ転送プロパティを取得または設定します。
構文
public TwainDataTransferProperties DataTransfer {get; set;}
'Declaration
 
Public Property DataTransfer As TwainDataTransferProperties
'Usage
 
Dim instance As TwainProperties
Dim value As TwainDataTransferProperties
 
instance.DataTransfer = value
 
value = instance.DataTransfer

            

            
public:
property TwainDataTransferProperties DataTransfer {
   TwainDataTransferProperties get();
   void set (    TwainDataTransferProperties value);
}

属性値

TwainDataTransferProperties構造体は、imageエフェクトデータクラスを格納します。
解説
このプロパティは呼び出した後に呼び出されなければなりません取得します、TwainSession.Propertiesプロパティはこの構造体を更新します、設定されたTwainSession.Propertiesプロパティを呼び出すことによってTWAINソースを更新することができます。
サンプル
Copy Code  
Imports Leadtools
 Imports Leadtools.Twain

#If Not LEADTOOLS_V19_OR_LATER Then
      Public Sub DataTransferPropertyExample(ByVal parent As IWin32Window)
#Else
      Public Sub DataTransferPropertyExample(ByVal parent As IntPtr)
#End If ' #If LEADTOOLS_V19_OR_LATER Then
         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:\Users\Public\Documents\LEADTOOLS Images"
 End Class
using Leadtools;
 using Leadtools.Twain;

#if !LEADTOOLS_V19_OR_LATER
      public void DataTransferPropertyExample(IWin32Window parent)
#else
      public void DataTransferPropertyExample(IntPtr parent)
#endif // #if !LEADTOOLS_V19_OR_LATER
      {
         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:\Users\Public\Documents\LEADTOOLS Images";
 }
必要条件

ターゲットプラットホーム

参照

参照

TwainProperties構造体
TwainPropertiesメンバ