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

フレームを表示

Capabilityプロパティ(TwainTemplateEventArgs)






イベントによって現時点では処理されているTwainCapabilityを取得します。
構文
public TwainCapability Capability {get;}
'Declaration
 
Public ReadOnly Property Capability As TwainCapability
'Usage
 
Dim instance As TwainTemplateEventArgs
Dim value As TwainCapability
 
value = instance.Capability

            

            
public:
property TwainCapability^ Capability {
   TwainCapability^ get();
}

属性値

イベントによって現時点では処理されているTwainCapability。
サンプル
Copy Code  
Imports Leadtools
      Imports Leadtools.Twain

      Public Sub twnSession_SaveTemplate(ByVal sender As Object, ByVal e As TwainTemplateEventArgs)
         Dim twCap As TwainCapability = e.Capability
         If twCap.Information.ContainerType = TwainContainerType.OneValue Then
            If CType(twCap.OneValueCapability.Value, TwainCapabilityValue) = TwainCapabilityValue.TransferMechanismFile Then
               MessageBox.Show("File transfer avaialble and its container is OneValue")
            End If
         End If
      End Sub

#If Not LEADTOOLS_V19_OR_LATER Then

      Public Sub CapabilityPropertyExample(ByVal parent As IWin32Window)
#Else

      Public Sub CapabilityPropertyExample(ByVal parent As IntPtr)
#End If ' #If LEADTOOLS_V19_OR_LATER Then
         Dim session As TwainSession = New TwainSession()
         session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None)

         AddHandler session.SaveTemplate, AddressOf twnSession_SaveTemplate
         session.SaveTemplateFile(Path.Combine(LEAD_VARS.ImagesDir, "Out_test.ltt"))

         session.Shutdown()
      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;

      public void twnSession_SaveTemplate(object sender, TwainTemplateEventArgs e)
      {
         TwainCapability twCap = e.Capability;
         if (twCap.Information.ContainerType == TwainContainerType.OneValue)
         {
            if (twCap.OneValueCapability.Value == (object)TwainCapabilityValue.TransferMechanismFile)
            {
               MessageBox.Show("File transfer avaialble and its container is OneValue");
            }
         }
      }
#if !LEADTOOLS_V19_OR_LATER
      public void CapabilityPropertyExample(IWin32Window parent)
#else
      public void CapabilityPropertyExample(IntPtr parent)
#endif // #if !LEADTOOLS_V19_OR_LATER
      {
         TwainSession session = new TwainSession();
         session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None);

         session.SaveTemplate += new EventHandler<TwainTemplateEventArgs>(twnSession_SaveTemplate);
         session.SaveTemplateFile(Path.Combine(LEAD_VARS.ImagesDir, "Out_test.ltt"));

         session.Shutdown();
      }

      static class LEAD_VARS
      {
      public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
      }
必要条件

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

参照

参照

TwainTemplateEventArgsクラス
TwainTemplateEventArgsメンバ