问题描述
我正在使用Delphitwain(delphitwain.sourceforge.net)向我的应用程序添加扫描功能.一切都很好,当我单击应用程序上的扫描按钮时,它将显示具有扫描仪属性(例如页面大小,扫描面(佳能dr-3010c))的扫描模式,并且有一个扫描按钮和一个取消按钮.如果我单击取消",当然所有属性都将恢复为之前的值.
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;
ShowUI的第一个True,模态的第二个True
The first True for ShowUI and the second True for Modal
我知道这是可以实现的,因为我见过另一个可以显示扫描仪属性而无需扫描的应用程序,只有确定"和取消"按钮,我到处搜索了google,但没有运气,或者可能只是它的局限性delphitwain组件?谢谢,任何建议表示赞赏
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
推荐答案
它在TTwainSource类(名为ShowUI)中具有布尔属性.使用该属性,您可以控制是否显示扫描仪的本机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.
但是请注意,无论将ShowUI设置为True还是False,某些扫描仪都会强制显示其UI.
But take note that some scanners show their UI forcefully whether you set ShowUI to True or False.
这篇关于DelphiTwain如何显示表单设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!