DelphiTwain如何显示表单设置
我正在使用 Delphitwain (delphitwain.sourceforge.net) 向我的应用程序添加扫描功能。一切都很好,当我单击应用程序上的扫描按钮时,它将显示扫描模式以及扫描仪的属性,例如页面大小、扫描面(佳能 dr-3010c),并且有一个扫描按钮和取消按钮。如果我单击“取消”,当然所有属性都会恢复到之前的值。
我怎样才能显示此扫描仪的属性仅更改属性而不扫描,因为我可以进行扫描而不显示属性
Twain.LoadLibrary;
Twain.LoadSourceManager;
Twain.Source[CurrentSource].Loaded := TRUE;
Twain.Source[CurrentSource].TransferMode := TTwainTransferMode(0);
Twain.Source[CurrentSource].EnableSource(True, True);
while Twain.Source[CurrentSource].Enabled do Application.ProcessMessages;
Twain.UnloadLibrary;
Twain.Source[CurrentSource].EnableSource(True, True);
第一个 True 用于 ShowUI,第二个 True 用于 Modal
我知道它可以实现,因为我看到了另一个应用程序,可以显示扫描仪的属性而无需扫描,只有“确定”和“取消”按钮,我已经搜索了谷歌,但没有运气,或者也许这只是 delphitwain 组件的限制?谢谢,任何建议表示赞赏
I'm using Delphitwain (delphitwain.sourceforge.net) to add scan functionality to my app. Everything was fine, when i click scan button on my app it will show scan mode with scanner's Properties such as Page Size, Scanning Side (canon dr-3010c) and there is a Scan button and Cancel button. If i click cancel of course all the properties back to it's value before.
How can I show this Scanner's Properties only to change properties without Scan, since i can do scan without showing properties
Twain.LoadLibrary;
Twain.LoadSourceManager;
Twain.Source[CurrentSource].Loaded := TRUE;
Twain.Source[CurrentSource].TransferMode := TTwainTransferMode(0);
Twain.Source[CurrentSource].EnableSource(True, True);
while Twain.Source[CurrentSource].Enabled do Application.ProcessMessages;
Twain.UnloadLibrary;
Twain.Source[CurrentSource].EnableSource(True, True);
The first True for ShowUI and the second True for Modal
I know it can be achieved 'cos i've seen another application that can show scanner's properties without scan, only OK and Cancel button, i've searched google all over but no luck, or maybe it just the limitation of the delphitwain component? Thanks, any suggestion appreciated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它在名为 ShowUI 的 TTwainSource 类中有一个布尔属性。使用该属性,您可以控制是否应显示扫描仪的本机 UI。
但请注意,无论您将 ShowUI 设置为 True 还是 False,某些扫描仪都会强制显示其 UI。
It has a boolean property in TTwainSource class named ShowUI. Using that property, you can control whether native UI of the scanner should be shown or not.
But take note that some scanners show their UI forcefully whether you set ShowUI to True or False.