Guide for VB.NET
Core Document Formats
Additional Features
Specify Size and Location to Scan

VB.NET TWAIN - Set Size and Location for Scanning

Guide for Setting Size and Location for TWAIN Image Scanning in VB.NET

VB.NET
Home > .NET Imaging SDK > VB.NET > TWAIN: Specify Size and Location to Scan
To get started with DocImage SDK for .NET, you are supposed to read VB.NET Imaging: Get Started first!

With our VB.NET TWAIN Scanning Add-On, developers are able to specify the image location to start TWAIN scanning and specific image size for TWAIN scanning through VB.NET programming. Here is a detailed VB.NET guide on which you will find answers to all of the following questions.
Related .net document control helps:
asp.net dicom library: ASP.NET Dicom Document Viewer Control: view, annotate dicom imaging files online in ASP.NET
asp.net pdf editor component: EdgePDF: ASP.NET PDF Editor Web Control: Online view, annotate, redact, edit, process, convert PDF documents
asp.net edit pdf text control: ASP.NET PDF Text Edit Control: online edit PDF text content using C# ASP.NET
asp.net pdf viewer control free: ASP.NET PDF Viewer Control: view, navigate, zoom Adobe PDF document in C# ASP.NET
c# asp.net mvc document viewer: ASP.NET Document Viewer using C#: Open, View, Annotate, Redact, Convert document files in ASP.NET using C#, HTML5, JQuer...
asp.net mvc image viewer: ASP.NET Image Viewer Control(MVC & WebForms): view, annotate, redact, convert image files in html, JQuery
c# asp.net mvc document viewer: ASP.NET MVC Document Viewer: view, annotate, redact files on ASP.NET MVC web projects
  • What class will be used to set the size and location for TWAIN image scanning in VB.NET application?
  • How to specify the size only for TWAIN image scanning in .NET application using VB language?
  • How to set both location and size for TWAIN image scanning using VB.NET demo code?
  • Why choose our product to set size and location for TWAIN scanning in VB.NET class?
Required Class
If you are intending to use our .NET TWAIN Scanning Add-On to specify the size and location for your TWAIN image scanning in VB.NET program, one class will be used. It is the Device object which can be obtained through methods from Acquisition class. The Device object includes APIs to make supported TWAIN device capabilities available or unavailable. After getting the Device object, you need to use it open connection to target TWAIN device. Then, you can customize your TWAIN image scanning in VB.NET by setting image size and location.
Specify Size Only for TWAIN Scanning
It is easy to specify the size for TWAIN image scanning in VB.NET application by using our .NET TWAIN Scanning Add-On. You need to make sure whether TWAIN and one or more TWAIN compatible devices are installed in your system. Besides, in order to use this .NET Add-On, you may install .NET Framework 2.0 or later versions. Then, you can copy the following VB.NET sample code to your project to specify image size to scan. Please pay attention that this Add-On can be used in VB.NET project created in Visual Studio 2005 or later versions.
''' <summary>
''' suppose the device is opened
''' </summary>
Public Sub SpecifySizeToScan(device As Device)
' Get a list of supported frames and choose the one that fits your needs.
Dim frames As TwainStaticFrameSizeType() = device.GetSupportedFrameSizes()
For Each frame As TwainStaticFrameSizeType In frames
If frame = TwainStaticFrameSizeType.LetterUS Then
Me.device.FrameSize = frame
Exit For
End If
Next
End Sub
In the VB.NET sample code, SpecifySizeToScan method is used to specify the size for TWAIN image scanning. To set the size, you may need to use device.GetSupportedFrameSizes() method to know what frame sizes are supported by the TWAIN device. Then, you can choose certain frame size that meets your requirements.
Set Location and Size for TWAIN Scanning
The following VB.NET demo code can be used to set the location and size for TWAIN image scanning simultaneously. SpecifyLocationAndSizeToScan can be used to realize both size and location setting. TwainUnitType method is used to choose measuring unit from supportive types and this demo code gives an example of choosing inch as the unit. By calling RectangleF method, you are able to set certain area to be covered for TWAIN image scanning.
''' <summary>
''' suppose the device is already opened
''' </summary>
''' <param name="device"></param>
Public Sub SpecifyLocationAndSizeToScan(device As Device)
device.Units = UnitType.Inches
If device.Units <> TwainUnitType.Inches Then
Return
End If
device.Frame = New System.Drawing.RectangleF(0, 0, 8.5, 11)
End Sub
Why Choose RasterEdge's Product?
Our .NET TWAIN Scanning Add-On is an advanced control widely used by VB.NET developers and end users. What makes they choose our product are powerful functions of this Add-On and our good after-sale services. If you want to apply TWAIN Image Scanning Control into C#.NET program, you may refer to this C# guide for utilizing our .NET TWAIN Scanning Add-On.

Powerful Functions

RasterEdge TWAIN Scanning Add-On for VB.NET not only enables developers to specify the size and location for TWAIN image scanning, but also allows you to conduct Console based TWAIN scanning and scan many pages into a single PDF document through VB.NET programming. It also provides automatic document feeder support, which means it can enable or disable automatic document feeder available in scanners according to your own needs.

After-Sale Services

After you purchase our VB.NET TWAIN Scanning Add-On, you can contact with us if there is any problem. We will solve your problem as soon as possible. You are also allowed to upgrade your purchased product within period of validity if you have a demand.


Recommend this to Google+


RasterEdge.com is professional provider of ASP.NET MVC Document Viewer, ASP.NET PDF Viewer, MVC PDF Viewer document, content and imaging solutions, available for ASP.NET AJAX, Silverlight, Windows Forms as well as WPF. We are dedicated to provide powerful & profession imaging controls, PDF document, image to pdf files and components for capturing, viewing, processing, converting, compressing and stroing images, documents and more.

©2000-2017 Raster Edge.com