Gets or sets image resolution properties for the current data source.
public TwainImageResolutionProperties ImageResolution { get; set; }
Public Property ImageResolution As TwainImageResolutionProperties
public:
property TwainImageResolutionProperties ImageResolution {
TwainImageResolutionProperties get();
void set ( TwainImageResolutionProperties );
}
TwainImageResolutionProperties structure contains Image effects data class.
This property should be called after calling the get Properties property After you update this structure, you can update the TWAIN source by calling the set Properties property.
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;
}
public void ImageResolutionPropertyExample(IntPtr parent)
{
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);
}
}
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
Public Sub ImageResolutionPropertyExample(ByVal parent As IntPtr)
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
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document