WPF C# - Scanning several images via ADF

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

Moderator: Alex

Post Reply
chrisi
Posts: 2
Joined: Tue Aug 29, 2017 1:46 pm

WPF C# - Scanning several images via ADF

Post by chrisi » Tue Aug 29, 2017 2:01 pm

Hello,

First i want to mention that I am currently using the evaluation version!

I am working on a project where i want to scan several images via ADF and save each image in a own file!
For this I acquire Images synchroniously and save the acquired image to C://... .bmp as following code shows:

Code: Select all

case AcquireModalState.ImageAcquired:
    imageIndex++;
    string _url = @"C:\document_" + imageIndex + ".bmp"; 
                        
    TwainBmpEncoderSettings encoderSettings = new TwainBmpEncoderSettings();
    SelectedDevice.AcquiredImage.SaveToFile(_url, encoderSettings );

    // dispose acquired image
    SelectedDevice.AcquiredImage.Dispose();
                        
    // output current state
    response += string.Format("Document is saved to: {0}", _url);
    break;
...
Problem: When I start the acquiring process the scanner (Brother MFC L27000DW) is scanning all images but there is only one file saved with the first image in it!

Is there something wrong in my code or does this problem may concerns to the Scanner?

Thanks for help!

Alex
Site Admin
Posts: 1464
Joined: Thu Jul 10, 2008 2:21 pm

Re: WPF C# - Scanning several images via ADF

Post by Alex » Thu Aug 31, 2017 3:55 pm

Hello,

Your code looks correct but I cannot say more because I do not see all your code.

Old TWAIN drivers of Brother scanners scan all pages from ADF but return only the last image if UI is disabled:
https://www.vintasoft.com/forums/viewtopic.php?f=19&t=3

Maybe you have such "old" TWAIN driver? If yes, try to update your driver.

Best regards, Alexander

chrisi
Posts: 2
Joined: Tue Aug 29, 2017 1:46 pm

Re: WPF C# - Scanning several images via ADF

Post by chrisi » Thu Aug 31, 2017 5:03 pm

Hej Alex,

I tried to update the driver and now it works fine!

Thanks for your response.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest