简体   繁体   English

OS X Mac和编写twain扫描应用程序

[英]OS X Mac and writing a twain scanning application

Can someone point me to the correct place to start development of a twain scanning appliation for the MAC osx. 有人能指出我正确的地方开始为MAC osx开发twain扫描应用程序。 I have done some simple objective c development in the past, but nothing interfacing with a device. 我过去做过一些简单的客观c开发,但没有与设备连接。

If you're talking about Objective-C and TWAIN on the Mac, this page on the twain.org site has a DMG you can download which contains a sample project called TWAINClientCocoa. 如果您在Mac上讨论Objective-C和TWAIN,twain.org网站上的这个页面有一个可以下载的DMG,其中包含一个名为TWAINClientCocoa的示例项目。

It's from 2002 or something so it requires a little finagling to get it to load and build (rename the .pbproj folder to be a .xcode folder so it will open in Xcode and then do an "upgrade" when you're in Xcode) but it works (just tried it last week) and should give you a good starting point. 它是从2002年开始的,所以它需要一点点才能让它加载和构建(将.pbproj文件夹重命名为.xcode文件夹,这样它就会在Xcode中打开,然后在你进入Xcode时进行“升级”)但它的确有效(上周才试过),应该给你一个很好的起点。 It relies on the concept of the TWAIN source providing its on GUI but that's something you could modify. 它依赖于TWAIN源的概念,提供了GUI,但这是你可以修改的东西。

If someone if still interested in this, I have just written a TWAIN client on macOS for my application. 如果有人仍然对此感兴趣,我刚刚在macOS上为我的应用程序编写了一个TWAIN客户端。 This documentation is quite helpful. 这个文档非常有用。

The main problem doing this today is that the PicHandle returned by native transfer mode requires some deprecated functions to operate on. 今天这样做的主要问题是本机传输模式返回的PicHandle需要一些不推荐使用的函数来操作。 On my system (10.13) I can workaround this by making up the headers for those functions but they might be removed totally some time in the future. 在我的系统(10.13)上,我可以通过编写这些函数的标题来解决这个问题,但是将来可能会完全删除它们。 It's probably worth trying to use memory transfer mode which is more complex. 尝试使用更复杂的内存传输模式可能是值得的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM