Inline SVG Content not displaying in IE Screenshot

前端 未结 2 1317
囚心锁ツ
囚心锁ツ 2020-12-15 11:00

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 al

相关标签:
2条回答
  • 2020-12-15 11:41

    You can also set a doctype of HTML4 strict or HTML5.

    <!DOCTYPE HTML>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    

    From http://www.seowarp.com/blog/2011/06/svg-scaling-problems-in-ie9-and-other-browsers/ :

    Before I begin, I’d just like to point out that on my test page, Internet Explorer 9 refused to display any of my SVG images on a basic HTML page until I declared the HTML4 strict or HTML5 doctypes.

    0 讨论(0)
  • 2020-12-15 11:55

    The answer came from Ted Johnson of IEBlog:

    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">
    

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

    0 讨论(0)
提交回复
热议问题