【发布时间】:2015-12-12 17:37:50
【问题描述】:
截图:
当尝试在 MS Access 2010 的 IE Web 浏览器控件中显示大图像(大于 5000x5000)时,图像不会显示。
我正在使用 VBA 来导航并将内容写入对象的文档。我已经测试了这两种方法,并且得到了相同的结果。较小的图像可以毫无问题地呈现。
LE 代码如下:
Private Sub DisplayImg(bWrite As Boolean)
Dim sHTMLFilePath As String
Dim sImageFilePath As String
Dim sContent As String
sImageFilePath = "d:\img.png"
sHTMLFilePath = "d:\html.html"
sContent = "<html>"
sContent = sContent & vbCrLf & "<head>"
sContent = sContent & vbCrLf & "</head>"
sContent = sContent & vbCrLf & "<style>"
sContent = sContent & vbCrLf & GetCSS ' gets css from db
sContent = sContent & vbCrLf & "</style>"
sContent = sContent & vbCrLf & "<body>"
sContent = sContent & vbCrLf & "<img class=" & Chr(34) & "img_wb" & Chr(34) & " src=" & Chr(34) & sImageFilePath & Chr(34) & ">"
sContent = sContent & vbCrLf & "</body>"
sContent = sContent & vbCrLf & "</html>"
If bWrite = False Then ' navigate
Call CreateNewTextFile(sHTMLFilePath, sContent) ' creates the html file
Me.wb.navigate sHTMLFilePath
Else ' write
Me.wb.Document.Clear
Me.wb.Document.write sContent
Me.wb.Document.Close
End If
End Sub
【问题讨论】:
-
能否提供测试代码?
-
我将代码添加到我最初的问题中。谢谢。
标签: image vba browser web resolution