老师,我的项目以前发布后使用没问题。前天整合论坛里图片管理器增加拍照扫描功能的实例成功,发布后再本机上使用没问题,但在其它电脑上使用出现以下错误提示。请分析一下原因。谢谢!
.NET Framework 版本:2.0.50727.5485
Foxtable 版本:2015.12.22.1
错误所在事件:项目,AfterOpenProject
详细错误信息:
“UserCode”的类型初始值设定项引发异常。
No devices of the category
他的项目全局代码如下:
'Public Scan As AxScanlibctl.aximgscan '定义图像扫描控件
'拍照事件
Public Sub LinkLabel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Forms("拍照").Open
End Sub
'扫描事件
Public Sub LinkLabel1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim frm As WinForm.Form = Forms("图片管理器")
Dim piv As WinForm.PictureViewer = Forms("图片管理器").Controls("PictureViewer1")
Dim imageFile As WIA.imageFile
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
Dim path As String = ProjectPath & "Attachments\sm" & Format(Date.Now,"yyyyMMddHHmmss") & ".jpg"
imageFile.SaveFile(path)
piv.AddFile(FileSys.GetName(path))
End If
Catch generatedExceptionName As System.Runtime.InteropServices.COMException
MessageBox.Show("您的扫描仪尚未准备好!","错误",MessageBoxButtons.OK,MessageBoxIcon.Error)
End Try
End Sub
'左转90
Public Sub LinkLabel2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim piv As WinForm.PictureViewer = Forms("图片管理器").Controls("PictureViewer1")
Dim zp As String = piv.SelectedItem
If zp IsNot Nothing Then
Dim bmp As New bitmap(zp)
bmp.RotateFlip(RotateFlipType.Rotate90FlipNone)
bmp.save(zp)
Dim obj As object = piv.basecontrol.Controls(0)
Dim pic As Object = obj.panel1.controls("PictureSplitContainer").Panel1.controls("panel2").controls("C1PictureBox1")
pic.Image = bmp
End If
End Sub
'右转90
Public Sub LinkLabel3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim piv As WinForm.PictureViewer = Forms("图片管理器").Controls("PictureViewer1")
Dim zp As String = piv.SelectedItem
If zp IsNot Nothing Then
Dim bmp As New bitmap(zp)
bmp.RotateFlip(RotateFlipType.Rotate270FlipNone)
bmp.save(zp)
Dim obj As object = piv.basecontrol.Controls(0)
Dim pic As Object = obj.panel1.controls("PictureSplitContainer").Panel1.controls("panel2").controls("C1PictureBox1")
pic.Image = bmp
End If
End Sub
'打印
Public Sub LinkLabel4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim piv As WinForm.PictureViewer = Forms("图片管理器").Controls("PictureViewer1")
If piv.SelectedItem IsNot Nothing Then
Dim doc As New PrintDoc '定义一个报表对象
Dim rm As New prt.RenderImage '定义一个图片对象
rm.Image = getImage(piv.SelectedItem)
doc.Body.Children.Add(rm) '将图片对象加入报表
Doc.Preview() '预览
End If
End Sub
'摄像头
Public _Cap As DCap.Capture
Public _Cams As DCap.Filters = New DCap.Filters()
Public _Cam As DCap.Filter
Public _CamList As New List(Of String)
Public _CamIndex As Integer