C# TWAIN 交互
我正在尝试设置一个使用 TWAIN 代码项目中的示例
这工作正常,除了我需要将 Form
转换为 IMessageFilter
并且 调用 IMessageFilter.PreFilterMessage()
捕获 TWAIN 回调。
另外,我需要通过调用
Application.AddMessageFilter();
Is there a way to do the same thing in WPF Window? 来启动此过滤? (添加消息过滤器并捕获 TWAIN 回调)。
另一个完全高层次的问题: 有人知道替代的 C# TWAIN 库\包装器吗?
谢谢。
I'm trying to set up a C# application which uses TWAIN example from code project
This works fine except that I need to cast Form
to IMessageFilter
and
call IMessageFilter.PreFilterMessage()
to catch TWAIN callbacks.
Also I need to start this filtering by calling
Application.AddMessageFilter();
Is there a way to do same thing in WPF Window? (To add message filter and catch TWAIN callbacks).
Another totally high level question:
Does anybody know about alternative C# TWAIN libraries\wrappers?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我刚刚完成了 Thomas Scheidegger 文章中的代码 (CodeProject: .NET TWAIN 图像扫描) 进入 github 项目
我已经清理了一些 API 并添加了 WPF 支持,所以检查一下。 :)
它有一个简单的 WPF 应用程序,展示了消息过滤如何与 WPF 一起工作。
I've just wrapped up the code from Thomas Scheidegger's article (CodeProject: .NET TWAIN image scanning) into github project
I've cleaned up the API a bit and added WPF support, so check it out. :)
It has a simple WPF application that shows how the message filtering works with WPF.
您可以使用
ComponentDispatcher.ThreadFilterMessage
事件进行尝试。据我了解,它在 WPF 中的用途与
Application.AddMessageFilter() 相同WinForms 中的
。You could try it with the
ComponentDispatcher.ThreadFilterMessage
event.As far as I understand, it serves the same purpose in WPF as
Application.AddMessageFilter()
in WinForms.我认为 TWAIN 已经过时了。 也许看看 WIA,它就完成了这项工作操作系统。 codeproject 上还有示例。
关于WPF相关问题,不知道,我只在Windows窗体应用程序中使用它。
I thought TWAIN is considered obsolete. Maybe take a look at WIA, that does this job since WinXP. There is also a sample at codeproject.
About the WPF related question, no idea, I only used it in windows forms apps.