Is it possible in TWAIN to force a scanner to set the region to the entire width?

纵然是瞬间 提交于 2019-12-01 07:37:38

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:

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).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!