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

フレームを表示

QuerySourceInformationメソッド






利用できるTWAINデータソースに関する情報を取得します。
構文
public TwainSourceInformation[] QuerySourceInformation()
'Declaration
 
Public Function QuerySourceInformation() As TwainSourceInformation()
'Usage
 
Dim instance As TwainSession
Dim value() As TwainSourceInformation
 
value = instance.QuerySourceInformation()

            

            
public:
array<TwainSourceInformation>^ QuerySourceInformation(); 
解説
詳細については、「TWAINソースの管理」を参照してください。
サンプル
Copy Code  
Imports Leadtools
 Imports Leadtools.Twain

#If Not LEADTOOLS_V19_OR_LATER Then
      Public Sub QuerySourceInformationExample(ByVal parent As IWin32Window)
#Else
      Public Sub QuerySourceInformationExample(ByVal parent As IntPtr)
#End If ' #If LEADTOOLS_V19_OR_LATER Then
         Dim buffer As String
         Dim session As TwainSession = New TwainSession()
         session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None)
         Dim srcInfo As TwainSourceInformation() = session.QuerySourceInformation()

         Dim i As Integer = 0
         Do While i < srcInfo.Length
            buffer = String.Format("Source Name = {0}" & Constants.vbLf & "Product Family Name = {1}" & Constants.vbLf & "Manufacturer Name = {2}" & Constants.vbLf, srcInfo(i).Name, srcInfo(i).ProductFamily, srcInfo(i).Manufacturer)

            MessageBox.Show(buffer)
            i += 1
         Loop
         session.Shutdown()
      End Sub
using Leadtools;
 using Leadtools.Twain;

#if !LEADTOOLS_V19_OR_LATER
      public void QuerySourceInformationExample(IWin32Window parent)
#else
      public void QuerySourceInformationExample(IntPtr parent)
#endif // #if !LEADTOOLS_V19_OR_LATER
      {
         string buffer;
         TwainSession session = new TwainSession();
         session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None);
         TwainSourceInformation[] srcInfo = session.QuerySourceInformation();

         for (int i=0; i < srcInfo.Length; i++)
         {
            buffer = String.Format("Source Name = {0}\nProduct Family Name = {1}\nManufacturer Name = {2}\n",
               srcInfo[i].Name, srcInfo[i].ProductFamily, srcInfo[i].Manufacturer);

            MessageBox.Show(buffer);
         }
         session.Shutdown();
      }
必要条件

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

参照

参照

TwainSessionクラス
TwainSessionメンバ
SelectedSourceNameメソッド