我在做一个小系统 但是遇到要用VC操纵扫描仪 想问一下有关的API 函数 只知道在VC与扫描仪接口中有一个Twain函数 但是不知道怎么用与之相关的还有什么函数请众位指点 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这需要懂WIN32 DDK。查MSDN吧 不麻烦的。所有的扫描仪,基本上吧,都是一个驱动,一个库,那就是Twain的库,他是一个免费的东西,很好用的,可以到它的网站上下载最新的库。其他的如kodak等都是基于这个库的。 我有一段代码CString str,strPath,strFile[4]; int ScanFileType[4]={3,6,8,1}; strFile[0]=".bmp"; strFile[1]=".jpeg"; strFile[2]=".gif"; strFile[3]=".tif"; UpdateData(true); try{ CFileFind f; char chPath[100]; GetModuleFileName(NULL, chPath, MAX_PATH); strPath=chPath; strPath=strPath.Left(strPath.ReverseFind('\\')); strPath=strPath+"\\fj"; f.FindFile(strPath,0); if(!(f.FindFile(strPath,0))) CreateDirectory(strPath,NULL);//创建一个目录 strPath=strPath+"\\"+m_filename+strFile[m_filetype]; m_scaner.SetFileType((long)ScanFileType[m_filetype]); m_scaner.SetImage(strPath); m_scaner.StartScan(); str.Format("%d",i); i++; m_filename=m_filename+str; UpdateData(false); str="已扫描第"+str+"文件!"; ::MessageBox(this->m_hWnd,str,"扫描文件",MB_OK); }catch (...) { ::MessageBox(this->m_hWnd,"扫描失败,请检查扫描仪!","扫描文件",MB_OK); } 请问楼主这个问题解决了吗? 我也遇到了控制扫描仪的问题,请高手再来详细解答一下呀!To:玉龙猪:在你的代码中,m_scaner是如何定义的? vc++6.0安装后能编译连接,但是不能运行,也不能新建c++文件? 关于多个HTMLVIEW切换和基于多文档视图的切换 为LISTCTRL的SUBITEM动态显示提示信息。 关于同时移动两个窗口(其中一个是不规则窗体) 请教一个关于GetFieldValue()函数的问题 急!哪位大仙有jpeg压缩和gif压缩的相关资料,最好有原码? 快来捡分。 如何实现VC下的资源编辑器功能? Win32汇编几乎成了C语言,没有汇编语言的味道 怎么设置UNICODE编译模式 怎么每次在打开一个盘符的时候,让它必须先自动运行我自己的窗口 如何实现类似音量控制-录音控制中的立体声录音选择功能?
CString str,strPath,strFile[4];
int ScanFileType[4]={3,6,8,1}; strFile[0]=".bmp";
strFile[1]=".jpeg";
strFile[2]=".gif";
strFile[3]=".tif";
UpdateData(true);
try{
CFileFind f;
char chPath[100];
GetModuleFileName(NULL, chPath, MAX_PATH);
strPath=chPath;
strPath=strPath.Left(strPath.ReverseFind('\\'));
strPath=strPath+"\\fj";
f.FindFile(strPath,0);
if(!(f.FindFile(strPath,0)))
CreateDirectory(strPath,NULL);//创建一个目录
strPath=strPath+"\\"+m_filename+strFile[m_filetype]; m_scaner.SetFileType((long)ScanFileType[m_filetype]);
m_scaner.SetImage(strPath);
m_scaner.StartScan();
str.Format("%d",i);
i++;
m_filename=m_filename+str;
UpdateData(false);
str="已扫描第"+str+"文件!";
::MessageBox(this->m_hWnd,str,"扫描文件",MB_OK); }catch (...) {
::MessageBox(this->m_hWnd,"扫描失败,请检查扫描仪!","扫描文件",MB_OK);
}