Page 1 of 1

WPF C# - Scanning several images via ADF

Posted: Tue Aug 29, 2017 2:01 pm
by chrisi
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!

Re: WPF C# - Scanning several images via ADF

Posted: Thu Aug 31, 2017 3:55 pm
by Alex
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

Re: WPF C# - Scanning several images via ADF

Posted: Thu Aug 31, 2017 5:03 pm
by chrisi
Hej Alex,

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

Thanks for your response.