老师,这是图片管理器增加拍照扫描功能实例 的保存照片的代码,提示未将对象引用设置到对象实例。请指点。谢谢!
Dim zp As Image = e.Form.Controls("照片").Image
Dim wjm As WinForm.Label = e.Form.Controls("文件名")
If zp IsNot Nothing Then
If Forms("图片管理器").Opened Then
Dim path As String = ProjectPath & "Attachments\" & wjm.text & ".jpg"
zp.Save(path)
Forms("图片管理器").Controls("PictureViewer1").AddFile(FileSys.GetName(path))
e.Form.Close
End If
Else
MessageBox.Show("请拍摄照片后再保存!","错误",MessageBoxButtons.OK,MessageBoxIcon.Error)
End If