安装完扫描仪驱动和Imaging for windows后在PB中引入imgscan.ocx和imgedit.ocx组件,然后编程:
下面是示例代码:
integer j
integer i
string storepath
string ls_path
IF messagebox("提示","进行扫描操作,请先将扫描资料放入扫描仪!",exclamation!,yesno!,1) = 2 THEN //1
// ROLLBACK USING sqlca_phtostore;
// ROLLBACK USING sqlca;
RETURN FALSE
END IF //1
ole_1.object.showsetupbeforescan = TRUE
j = THIS.ole_1.object.openscanner
IF j = 0 THEN //26
i = THIS.ole_1.object.startscan
ole_1.object.destimagecontrol = "ole_2"
ole_2.object.imagecontrol = "ole_1"
ELSE //26
messagebox("错误","使用扫描仪出错,请检查扫描仪是否处于可使用状态!",stopsign!)
// ROLLBACK USING sqlca_phtostore;
// ROLLBACK USING sqlca;
RETURN FALSE
END IF //26
THIS.ole_1.object.closescanner