Foxtable(狐表)用户栏目专家坐堂 → [求助]代码求助


  共有3043人关注过本帖树形打印复制链接

主题:[求助]代码求助

帅哥哟,离线,有人找我吗?
pcxjxjhkw
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:七尾狐 帖子:1791 积分:12764 威望:0 精华:1 注册:2013/7/18 15:51:00
[求助]代码求助  发帖心情 Post By:2015/4/15 19:46: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.GetBitmap()
        Return img
    End If
Catch generatedExceptionName As System.Runtime.InteropServices.COMException
    MessageBox.Show("您的扫描仪尚未准备好!","错误",MessageBoxButtons.OK,MessageBoxIcon.Error)
    Return Nothing
End Try

 回到顶部
帅哥哟,离线,有人找我吗?
pcxjxjhkw
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:七尾狐 帖子:1791 积分:12764 威望:0 精华:1 注册:2013/7/18 15:51:00
  发帖心情 Post By:2015/4/16 8:52:00 [显示全部帖子]

img = imageFile.GetBitmap()

主要问题是:如何将扫描到的图片保存到一个变量中?上面的代码出错,求改正。

 回到顶部