WIA吐温支持C#吐温、WIA

2023-09-03 13:41:48 作者:暖阳

我如何使用WIA和Twain在C#中?该TWIAIN / C#示例中的 HTTP://www.$c$cproject。 有人用不正确的格式加载程序的一种尝试。COM / KB / DOTNET / twaindotnet.aspx 抛出一个异常,在上TwainLib.cs 59行在Vista 64。

How can I use WIA and Twain in C#? The TWIAIN/C# example found at http://www.codeproject.com/KB/dotnet/twaindotnet.aspx Throws an exception at line 59 on TwainLib.cs "an attempt was made to load a program with an incorrect format." on Vista 64.

我会用威亚但它不具有用于所有设备的我想使用支持

I would use WIA but it does not have support for all of the devices I want to use.

有一个简单的方法,使TWAIN支持WIA在C#中?我知道这是可以做到的,但我找不到任何关于这个问题的文件。我不是在寻找一个商业产品。我可以找出如何使用WIA就好了 - 但它的事实,我不能让TWIAN支持,这是烦人

Is there a simple way to enable TWAIN support in WIA in C#? I know it can be done but I cannot find any documentation on the subject. I am not looking for a commercial product. I can figure out how to use WIA just fine - but its the fact that I cant enable TWIAN support that is annoying.

在C ++ / CLI或VB.net的例子也欢迎。

Examples in C++/CLI or VB.net are also welcome.

感谢。

修改

谢谢,cristianlibardo。你帮了我很多,我可能只是继续使用TWIAN现在。但我还是想用WIA;所以我不会接受你的答案。这是人们只看到这篇文章的一些详细信息。所有都是为了应对这样的回答:

Thanks, cristianlibardo. You helped me out a lot and I might just continue to use TWIAN for now. But I am still wanting to use WIA; so I will not accept your answer yet. Here is some more info for people just seeing this post. All are in response to this answer:

是啊,那这样做是为了TWIAN支持;谢谢!我还是想用威亚虽然;但现在我有一些帮助。但是,当我选择我的USB摄像头作为源和命中获取,应用程序挂起。我的相机与其他的,商业的,TWIAN应用程序。

Yup, that did it for the TWIAN support; thanks! I still want to use WIA though; but now I have something to work with. However, when I select my USB camera as the source and hit acquire, the app hangs. My camera works on other, commercial, TWIAN applications.

通过注释掉线100,虽然104(code,检查,看看是否DScap(APPID,SRCDS,TwDG.Control,TwDAT.Capability,TwMSG.Set,帽);收益TwRC.Success我的相机现在工作我不知道这是什么code做;作为文档下即没有就这个问题

By commenting out the lines 100 though 104 (code that checks to see if "DScap( appid, srcds, TwDG.Control, TwDAT.Capability, TwMSG.Set, cap );" returns TwRC.Success my Camera now works. I have no idea what this code does; as documentation is next-to-nothing on this subject.

确定;它是一个常量名为CAP_XFERCOUNT有是与每个会话扫描多张图片。使降神,一个摄像头不支持它。

OK; its a const called "CAP_XFERCOUNT" that has something to do with scanning multiple images per session. Makes seance that a camera would not support it.

推荐答案

可能是一个长镜头,但有你试图建立与x86架构平台的目标或更改线程的单元状态?

Probably a long shot but have your tried building with x86 as platform target or changing thread apartment state?