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

フレームを表示

ImageResolutionプロパティ






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

            

            
public:
property TwainImageResolutionProperties ImageResolution {
   TwainImageResolutionProperties get();
   void set (    TwainImageResolutionProperties value);
}

属性値

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

      Public Sub twainSession_SetProperty(ByVal sender As Object, ByVal e As TwainSetPropertyEventArgs)
         Dim msg As String = String.Format("Capability %d\nStatus = %d", e.Capability, e.Status)
         e.Stop = False
      End Sub
#If Not LEADTOOLS_V19_OR_LATER Then
      Public Sub ImageResolutionPropertyExample(ByVal parent As IWin32Window)
#Else
      Public Sub ImageResolutionPropertyExample(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)

            session.EnableSetPropertyEvent = True
            AddHandler session.SetProperty, AddressOf twainSession_SetProperty

            Dim props As TwainProperties = session.Properties
            Dim imageRes As TwainImageResolutionProperties = props.ImageResolution

            imageRes.UnitOfResolution = TwainImageUnit.Inches
            imageRes.BitsPerPixel = 1
            imageRes.HorizontalResolution = 150
            imageRes.VerticalResolution = 150
            imageRes.XScaling = 1
            imageRes.YScaling = 1
            imageRes.RotationAngle = 90

            imageRes.LeftMargin = 0
            imageRes.RightMargin = 0
            imageRes.TopMargin = 200
            imageRes.BottomMargin = 200

            props.EnableAutoFeed = True
            props.MaximumNumberOfPages = -1

            Dim buffer As String = String.Format("Duplex state = {0}", session.DuplexScanningMode.ToString())
            MessageBox.Show(buffer)

            props.ImageResolution = imageRes
            session.Properties = props
            session.Shutdown()
         Catch ex As Exception
            MessageBox.Show(ex.Message)
         End Try
      End Sub
using Leadtools;
      using Leadtools.Twain;

      void session_SetProperty(object sender, TwainSetPropertyEventArgs e)
      {
         string msg = string.Format("Capability %d\nStatus = %d", e.Capability, e.Status);
         e.Stop = false;
      }
#if !LEADTOOLS_V19_OR_LATER
      public void ImageResolutionPropertyExample(IWin32Window parent)
#else
      public void ImageResolutionPropertyExample(IntPtr parent)
#endif // #if !LEADTOOLS_V19_OR_LATER
      {
         try
         {
            TwainSession session = new TwainSession();
            session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None);

            session.EnableSetPropertyEvent = true;
            session.SetProperty += new EventHandler<TwainSetPropertyEventArgs>(session_SetProperty);
            TwainProperties props = session.Properties;
            TwainImageResolutionProperties imageRes = props.ImageResolution;

            imageRes.UnitOfResolution = TwainImageUnit.Inches;
            imageRes.BitsPerPixel = 1;
            imageRes.HorizontalResolution = 150;
            imageRes.VerticalResolution = 150;
            imageRes.XScaling = 1;
            imageRes.YScaling = 1;
            imageRes.RotationAngle = 90;

            imageRes.LeftMargin = 0;
            imageRes.RightMargin = 0;
            imageRes.TopMargin = 200;
            imageRes.BottomMargin = 200;

            props.EnableAutoFeed = true;
            props.MaximumNumberOfPages = -1;

            string buffer = string.Format("Duplex state = {0}", session.DuplexScanningMode.ToString());
            MessageBox.Show(buffer);

            props.ImageResolution = imageRes;
            session.Properties = props;
            session.Shutdown();
         }
         catch (Exception ex)
         {
            MessageBox.Show(ex.Message);
         }
      }
必要条件

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

参照

参照

TwainProperties構造体
TwainPropertiesメンバ