调用扫描仪
Private Sub Command2_Click()
r = TWAIN_SelectImageSource(Me.hWnd)
r = TWAIN_AcquireToClipboard(Me.hWnd, t%)
Picture1.Picture = Clipboard.GetData(vbCFDIB)
SavePicture Picture1, "d:\yinjian\zm" & Form5.Text25.Text & ".jpg"
end sub
模块:Declare Function TWAIN_AcquireToClipboard Lib "EZTW32.DLL" (ByVal hwndApp&, ByVal wPixTypes&) As Long
Declare Function TWAIN_SelectImageSource Lib "EZTW32.DLL" (ByVal hwndApp&) As Long
以上是调用扫描仪仪的代码,可是进去以后,发现"取消"按钮"一按就死机,还有设备里的图片无法清除?有何办法?
[最优解释]
1、SavePicture 方法只能保存bmp格式的位图,虽然你用了后缀jpg,但仍然是bmp位图,jpg将作为文件名的一部份。
2、清除图片方法:Picture1.Cls
3、到这里去下载VB用的清华紫光扫描仪:
http://www.geocities.com/smigman.geo/mci/download.html
http://www.pudn.com/downloads26/sourcecode/graph/text_recognize/detail83849.html
http://www.dosadi.com/EZTwain_User_Guide.pdf
[其他解释]
顶!~~