Convert VML graphic to bitmap on the ASP.NET serve

2019-08-17 11:46发布

问题:

I'm using RaphaelJS. The browser renders a chart for me (which is in VML as all my users are on IE). I want the user to be able to save this image and share it normally eg paste into an email, into powerpoint, into a document etc etc.

Problem is not many things can render VML. I can easily get the VML markup describing the image back to the server. All I want to do is convert it to some kind of more universal format eg PNG, BMP, GIFF, whatever which I can then allow the user to download.

I've seen lots of people struggling with this. I would have thought the seeing as VML is Microsoft's proprietary SVG format they might have at least provided facilities within their own languages (C#,VB.net) to convert VML to bitmaps.

Anyone know how?

(Incidentally I can't use PHP - I've seen a lot of people attempting to solve this with a PHP based solution)

Thanks :)

回答1:

You can use the Internet Explorer ActiveX control and screenshotting techniques to achieve this. See the open source tool IECapt as an example.

You could also evaluate whether a cloud service like Litmus API could be used.