C#TWAIN互动 [英] C# TWAIN interaction

查看:330
本文介绍了C#TWAIN互动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试建立一个使用TWAIN的C#应用​​程序代码项目示例

I'm trying to set up a C# application which uses TWAIN example from code project

除了我需要将Form强制转换为IMessageFilter并且 调用IMessageFilter.PreFilterMessage()捕获TWAIN回调.
另外,我还需要通过调用

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();

是否可以在WPF窗口中执行相同的操作? (添加消息过滤器并捕获TWAIN回调).

Is there a way to do same thing in WPF Window? (To add message filter and catch TWAIN callbacks).

另一个完全高级的问题: 有人知道替代的C#TWAIN库\包装器吗?

Another totally high level question: Does anybody know about alternative C# TWAIN libraries\wrappers?

谢谢.

推荐答案

您可以通过ComponentDispatcher.ThreadFilterMessage事件进行尝试.
据我了解,它在 WPF中具有相同的作用 WinForms 中作为Application.AddMessageFilter().

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.

这篇关于C#TWAIN互动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆