Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, November 2, 2005 7:04:47 AM(UTC)

Gabe  
Gabe

Groups: Registered, Tech Support
Posts: 46


This code will use Twain high level functions using LEADTOOLS .NET, this code will show you how to change the transfer options in an easy way, without having to go through setting the capabilities and modify their values.

 

LEADTOOLS .NET high level functions will deal with the capabilities internally and change their values and prepare the  acquire process in a very easy way.

 

The following is the code:

 

      // This function will acquire page and save it to file using file transfer mode

      private void AcquireUsingFileMode(TwainSession session)

      {

         try

         {

            // check if file transfer mode is supported or not

            if (session.IsFileTransferAvailable == false)

            {

               // the file transfer mode is not supported

               MessageBox.Show(this, "File transfer mode is not supported!");

               return;

            }

 

            // get the default transfer options

            session.GetTransferOptions();

 

            // set transfer mode to file

            session.TransferMode = TwainTransferModes.TwainTransferFile;

 

            // set transfer file format

            session.TransferFileFormat = (int)TwainCapabilityValue.FileFormatBmp;

 

            // set transfer file name, the file name will be used to save the acquired page

            session.TransferFileName = @"c:\test.bmp";

 

            // update transfer options

            session.SetTransferOptions();

 

            // Acquire the page from source and save it to file

            session.Acquire(TwainUserInterfaceFlags.Show | TwainUserInterfaceFlags.Modal);

 

            MessageBox.Show(this, "Acquired page is saved to file", "Acquire to File");

         }

         catch (Exception ex)

         {

            // failure occurred

            MessageBox.Show(this, ex.Message);

         }

      }

 

File Attachment(s):
Twain.zip (4kb) downloaded 44 time(s).
Gabe
Developer Support
LEAD Technologies, Inc.

LEAD Logo
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.070 seconds.