locked
twaincs RRS feed

  • Question

  • I looked for a TWAIN library suitable to use with C# and found twaincs. I tried it out with the test tool and the first test gave SUCCESS, but selecting Scan gave OPERATIONERROR. I looked for a forum for the library but Anyone familiar with this library? Anyone used it successfully? I need help.

    You know of another suitable library?

    Thank you,


    Jon Jacobs, There are 10 kinds of people: those who understand binary and those who don't

    • Moved by Fei Hu Monday, January 15, 2018 7:36 AM ThirdParty libs related
    Saturday, January 13, 2018 9:05 PM

All replies

  • Hello Jon,

    Based on your description, I am afraid that the issue is out of support of C# General Question forum which mainly discusses C# programming language, IDE, libraries, samples and tools.

    I suggest that you can consult your issue directly on relating forum for better solution and support. If I have misunderstood anything, please feel free to let me know.

    Thank you for your understanding and cooperation

    Best regards,

    Neil Hu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, January 15, 2018 7:36 AM
  • Jon,

    I’m not familiar with this library, but one way you could check if the problem is caused by something else (like the Twain device driver, or Twain Data Source Manager) is to test against another library.

     

    There’s a free evaluation you can readily use to test, which is the LEADTOOLS SDK (Disclosure: I work for the SDK’s vendor). You can obtain it from this page.

     

    The code to scan an image and save it to disk looks like this:

    // Acquire image from scanner
    TwainSession session = new TwainSession();
    session.Startup(this.Handle, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None);
    session.SelectSource(null); // Display Twain select dialog
    RasterImage img = session.AcquireToImage(TwainUserInterfaceFlags.Show);
    session.Shutdown();
    
    // Save image as PNG file
    RasterCodecs codecs = new RasterCodecs();
    codecs.Save(img, @"C:\test\output.png", RasterImageFormat.Png, 24);
    
    
    After you’re done testing, if you decide you don’t need LEADTOOLS, you can simply un-install the SDK.
    Monday, July 6, 2020 12:11 PM