Acquire more than one page - with user-interaction

Questions, comments and suggestions concerning VintaSoft Twain .NET SDK.

Moderator: Alex

Post Reply
mierli
Posts: 6
Joined: Tue Aug 13, 2013 8:09 am

Acquire more than one page - with user-interaction

Post by mierli »

Hello
I have a question to the "Acquire"-process - like your example:

Code: Select all

....
.....
AcquireModalState acquireModalState = AcquireModalState.None;
            int imageIndex = 0;
            do
            {
                acquireModalState = device.AcquireModal();
                switch (acquireModalState)
                {
                    case AcquireModalState.ImageAcquired:
                        // save image to file
                        device.AcquiredImages.Last.Save(multipageTiffFilename);
                        // output current state
                        Console.WriteLine(string.Format("Image{0} is saved.", imageIndex++));
                        break;
            
                    case AcquireModalState.ScanCompleted:
                        // close device and device manager
                        CloseDeviceAndDeviceManager(deviceManager, device);
                        // output current state
                        Console.WriteLine("Scan completed.");
                        break;
            
                    case AcquireModalState.ScanCanceled:
                        // close device and device manager
                        CloseDeviceAndDeviceManager(deviceManager, device);
                        // output current state
                        Console.WriteLine("Scan canceled.");
                        break;
            
                    case AcquireModalState.ScanFailed:
                        // close device and device manager
                        CloseDeviceAndDeviceManager(deviceManager, device);
                        // output current state
                        Console.WriteLine(string.Format("Scan failed: {0}", device.ErrorString));
                        break;
                }
            }
            while (acquireModalState != AcquireModalState.None);
....
....
I want create a user-dialog, that asks the user after every acquired page "scan complete? or another page...." - and if the user press the button "scan complete", the application saves the current document; if the user press the button "another page / or next page" the acquire-process should be continued.

How can I solve this issue?
Please have you a clue for my question?

Many thanks in advance for any help & best regards
Michael
Alex
Site Admin
Posts: 2303
Joined: Thu Jul 10, 2008 2:21 pm

Re: Acquire more than one page - with user-interaction

Post by Alex »

Hello Michael,

Do you want to create the user dialog for flatbed scanner, scanner with ADF or for any scanner?

Best regards, Alexander
mierli
Posts: 6
Joined: Tue Aug 13, 2013 8:09 am

Re: Acquire more than one page - with user-interaction

Post by mierli »

Hello Alexander
I think for any scanner - but what has to do with the user-dialoge?`


Thanks & best regards
Michael
Alex
Site Admin
Posts: 2303
Joined: Thu Jul 10, 2008 2:21 pm

Re: Acquire more than one page - with user-interaction

Post by Alex »

Hello Michael,

Your algorithm should do the following steps:
  • Start an image acquisition
  • Show a user dialog when image is acquired
  • Cancel OR finish image acquisition if user does not want to acquire more images
  • Start new image acquisition process OR continue current image acquisition process if user wants to acquire more images
Please read how to cancel the image acquisition process here:
http://www.vintasoft.com/docs/vstwain-d ... ition.html

Best regards, Alexander
Post Reply