I am writing an application that requires scanning in .net (c#
version 4.0
, Visual Studio 2010). I\'m using the TWAIN
API in order to
So, in case anyone is interested I ended up giving up on TWAIN entirely - I think it is simply not possible.
What I did instead was install:
gcc-core
, make
and libusb-win32
packages)After a whole heap of configuring, making and installing I finally was able to issue this command from the Cygwin prompt:
scanimage -t 30 -y 30 --mode Color --depth 8 --resolution 1200 --sharpness 2 --format=tiff --source TPU8x10 > out.tiff
and would you believe it out.tiff
was wide and sharp and a whole lot better than I could achieve with TWAIN.
So, it is a horrible kludge I know, but I don't have a whole heap of options (it must be a windows, thick client application that runs on a machine with a scanner connected), so I just launch this:
c:\cygwin\bin\bash.exe --login -c "scanimage -t 30 -y 30 --mode Color --depth 8 --resolution 1200 --sharpness 2 --format=tiff --source TPU8x10 > ~/out.tiff"
via a Process in the .NET application and when it returns I load up the file into a Bitmap and carry on as if nothing freaky just happened (means the application has now a whole heap of extra prerequisites and fiddly configuration steps, but, well, meh, sue me).