--
老师好,把图片扫描到"Attachments"子文件夹中“商品图标"文件夹后在图片管理器中图片无法浏览。
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