Products | Support | Email a link to this topic. | Send comments on this topic. | Back to Introduction - All Topics | Help Version 19.0.9.21
|
Leadtools.Twain Namespace > TwainSession Class : AcquireFast2 Method |
The starting page number where the numbering of the newly scanned files names starts. For example, if this parameter has the value 3, then the scanned files will have the name "BaseFileName_0003.bmp".
Pass -1 for this parameter to start numbering files from page 1, in this case the first scanned file will have the format "BaseFileName_0001.bmp".
public void AcquireFast2( string baseFileName, int startupPageNumber, TwainFastUserInterfaceFlags flags, TwainTransferMode transferMode, RasterImageFormat format, int bitsPerPixel, bool multiPage, int bufferSize, bool usePreferredBufferSize )
'Declaration
Public Sub AcquireFast2( _ ByVal baseFileName As String, _ ByVal startupPageNumber As Integer, _ ByVal flags As TwainFastUserInterfaceFlags, _ ByVal transferMode As TwainTransferMode, _ ByVal format As RasterImageFormat, _ ByVal bitsPerPixel As Integer, _ ByVal multiPage As Boolean, _ ByVal bufferSize As Integer, _ ByVal usePreferredBufferSize As Boolean _ )
'Usage
Dim instance As TwainSession Dim baseFileName As String Dim startupPageNumber As Integer Dim flags As TwainFastUserInterfaceFlags Dim transferMode As TwainTransferMode Dim format As RasterImageFormat Dim bitsPerPixel As Integer Dim multiPage As Boolean Dim bufferSize As Integer Dim usePreferredBufferSize As Boolean instance.AcquireFast2(baseFileName, startupPageNumber, flags, transferMode, format, bitsPerPixel, multiPage, bufferSize, usePreferredBufferSize)
public: void AcquireFast2( String^ baseFileName, int startupPageNumber, TwainFastUserInterfaceFlags flags, TwainTransferMode transferMode, RasterImageFormat format, int bitsPerPixel, bool multiPage, int bufferSize, bool usePreferredBufferSize )
The starting page number where the numbering of the newly scanned files names starts. For example, if this parameter has the value 3, then the scanned files will have the name "BaseFileName_0003.bmp".
Pass -1 for this parameter to start numbering files from page 1, in this case the first scanned file will have the format "BaseFileName_0001.bmp".
Imports Leadtools Imports Leadtools.Twain Public Sub twain_AcquireMulti2(ByVal sender As Object, ByVal e As TwainAcquireMultiPageEventArgs) Dim msg As String If e.FinishScan Then msg = String.Format("The page # {0} is scanned and saved to file name {1}", e.PageNumber, e.FileName) MessageBox.Show(msg) End If e.Cancel = False End Sub Public Sub AcquireFast2Example(ByVal parent As IntPtr) Dim session As TwainSession = New TwainSession() session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None) session.EnableAcquireMultiPageEvent = True AddHandler session.AcquireMultiPage, AddressOf twain_AcquireMulti2 ' 3, start page number to use when numbering output file names, output files should be test_0003.tif, test_0004.tif, ...etc session.AcquireFast2(Path.Combine(LEAD_VARS.ImagesDir, "test.tif"), 3, TwainFastUserInterfaceFlags.Show, TwainTransferMode.Buffer, RasterImageFormat.Tif, 1, True, 0, True) 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 twain_AcquireMulti2(object sender, TwainAcquireMultiPageEventArgs e) { string msg; if (e.FinishScan) { msg = String.Format("The page # {0} is scanned and saved to file name {1}", e.PageNumber, e.FileName); MessageBox.Show(msg); } e.Cancel = false; } public void AcquireFast2Example(IntPtr parent) { TwainSession session = new TwainSession(); session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None); session.EnableAcquireMultiPageEvent = true; session.AcquireMultiPage += new EventHandler<TwainAcquireMultiPageEventArgs>(twain_AcquireMulti2); session.AcquireFast2(Path.Combine(LEAD_VARS.ImagesDir, "Out_test.tif"), 3, // start page number to use when numbering output file names, output files should be test_0003.tif, test_0004.tif, ...etc TwainFastUserInterfaceFlags.Show, TwainTransferMode.Buffer, RasterImageFormat.Tif, 1, true, 0, true); session.Shutdown(); } static class LEAD_VARS { public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images"; }