嵌入式SVG内容未显示在IE屏幕快照中 [英] Inline SVG Content not displaying in IE Screenshot

查看:71
本文介绍了嵌入式SVG内容未显示在IE屏幕快照中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个缩略图器,由此服务可以在无格式的IE9控件中获取HTML内容的缩略图.通过DrawToBitmap调用以及几个GDI调用,一切都可以顺利进行,但是SVG内容未显示.其他一切似乎都很好,但没有SVG.

I'm working on a thumbnailer whereby a service takes thumbnail images of HTML content in a form-less IE9 control. Everything is working smoothly with a DrawToBitmap call along with a couple of GDI calls, but SVG content is not displaying. Everything else seems to display just fine, but no SVG.

我认为这与SVG在IE中的实现方式有关,但我不知道细节.有什么想法吗?

I figure that this has something to do with how SVG is implemented in IE, but I don't know the details. Any thoughts?

TIA.

推荐答案

答案来自IEBlog的Ted Johnson:

The answer came from Ted Johnson of IEBlog:

IE9没有单独的SVG引擎;都是一个DOM和呈现 管道.但是,如果您的文档不在9标准文档中 模式下,您将不会获得任何SVG内容.我认为默认情况下 .NET中的WebBrowser控件默认为兼容模式.尝试添加 HTML页面顶部的meta标签以强制IE9模式:

IE9 has no separate SVG engine; it’s all one DOM and rendering pipeline. However, if your document isn’t in 9 standards document mode, you’ll not get any SVG content. I think, by default, the WebBrowser control in .NET defaults to compatibility mode. Try adding a meta tag to the top of your HTML page to force IE9 mode:

<meta http-equiv="X-UA-Compatible" content="IE=9">

这确实打开了SVG渲染,就像电灯开关一样.

This, indeed, turned on SVG rendering like a light switch.

这篇关于嵌入式SVG内容未显示在IE屏幕快照中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆