IIS中的WIA扫描问题 [英] WIA Scanning issue in IIS
本文介绍了IIS中的WIA扫描问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我在IIS 7.5中部署我的Web应用程序后无法使用WIA进行扫描
我试过这个Windows 7和Server 2012.
甚至ScanImage功能也没有调用。当注释ShowAcquireImage行然后应用程序调用ScanImage函数,否则它会在浏览器中显示等待响应的消息。
任何帮助都非常感谢。
以下是我的扫描功能。
Hi Guys,
I am not able to scan using WIA after deploying my web application in IIS 7.5
I tried this in Windows 7 and Server 2012.
Even "ScanImage" function is not calling . When comment the line "ShowAcquireImage" then application calling ScanImage function otherwise it displays message as waiting for response in browser.
Any help is highly appreciated.
Below is my function for scanning.
<securitypermission(securityaction.demand,> _
Public Function ScanImage(ByVal outputFormat As ImageFormat, ByVal fileName As String) As System.Drawing.Image
If outputFormat Is Nothing Then
Throw New ArgumentNullException("outputFormat")
End If
MessageBox.Show("1")
Dim filePerm As New FileIOPermission(FileIOPermissionAccess.AllAccess, fileName)
filePerm.Demand()
MessageBox.Show("2")
Dim imageObject As ImageFile = Nothing
Try
If WiaManager Is Nothing Then
WiaManager = New CommonDialogClass()
End If
MessageBox.Show("3")
imageObject = WiaManager.ShowAcquireImage(WiaDeviceType.ScannerDeviceType, WiaImageIntent.ColorIntent, WiaImageBias.MinimizeSize, outputFormat.Guid.ToString("B"), True, False, False)
''I am getting issue on above line
MessageBox.Show("4")
'imageObject.SaveFile(fileName)
'Byte[] imageBytes = (byte[])imageObject.FileData.get_BinaryData();
Dim imageBytes As Byte() = imageObject.FileData.BinaryData()
' <– Converts the ImageFile to a byte array
Dim ms As New MemoryStream(imageBytes)
'System.Drawing.Image image = System.Drawing.Image.FromStream(ms);
Dim bmp As New Bitmap(System.Drawing.Image.FromStream(ms))
Dim fileName1 As String = "D:\VBTest111.jpg"
bmp.Save(fileName1, ImageFormat.Jpeg)
Return System.Drawing.Image.FromFile(fileName1)
Catch ex As COMException
Dim message As String = "Error scanning image"
Throw New WiaOperationException(message, ex)
Finally
If imageObject IsNot Nothing Then
Marshal.ReleaseComObject(imageObject)
End If
End Try
End Function
已添加预
标签。 />
[/编辑]
推荐答案
首先
1.请检查扫描仪有WIA司机
2.你在机器上运行的应用程序已经安装了WIA驱动程序。
First
1.please check that the scanner has WIA drivers
2.The application you are running on the machine has installed WIA drivers.
这篇关于IIS中的WIA扫描问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文