以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]求助修改代码  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=64707)

--  作者:pcxjxjhkw
--  发布时间:2015/2/27 15:42:00
--  [求助]求助修改代码
\'扫描图片 内部函数
\'\'无参数
\'\'返回值:输出图片
Dim imageFile As WIA.imageFile
Dim Img As Bitmap
Dim cdc As  New WIA.CommonDialogClass()
Try
    imageFile = cdc.ShowAcquireImage(WIA.WiaDeviceType.ScannerDeviceType, WIA.WiaImageIntent.TextIntent, WIA.WiaImageBias.MaximizeQuality, "{00000000-0000-0000-0000-000000000000}", True, True,False)
    If  imageFile IsNot Nothing Then
        img = imageFile
        Return img
    End If
Catch generatedExceptionName As System.Runtime.InteropServices.COMException
    MessageBox.Show("您的扫描仪尚未准备好!","错误",MessageBoxButtons.OK,MessageBoxIcon.Error)
    Return Nothing
End Try

报错
图片点击可在新窗口打开查看此主题相关图片如下:qq截图20150227154337.png
图片点击可在新窗口打开查看

--  作者:Bin
--  发布时间:2015/2/27 15:45:00
--  
img = imageFile
        Return img    值类型不一样,无法直接赋值的.  看看imageFile 是否有转为Image类型或者流的函数

--  作者:pcxjxjhkw
--  发布时间:2015/2/27 15:49:00
--  
如何修改呢?先谢谢了
--  作者:Bin
--  发布时间:2015/2/27 15:51:00
--  
你看一下帮助文档看看imageFile 是否有转为Image类型或者流的函数
--  作者:pcxjxjhkw
--  发布时间:2015/2/27 15:55:00
--  
没找到
--  作者:Bin
--  发布时间:2015/2/27 15:57:00
--  
试试
 imageFile.SaveFile ("路径地址")

img = getimage("路径地址")

不行我也没办法了.文档肯定有的,你找一下