简体   繁体   English

如何将div元素转换为图像

[英]how to convert div element into image

im using google charts for my application. 即时通讯使用谷歌图表为我的应用程序。 i've to convert the chart into png image and store that image file in local. 我必须将图表转换为png图像并将该图像文件存储在本地。 for that i've used like this but i cant to convert the chart to image in IE8, i should code for IE8 also. 对,我用像这样 ,但我不能到图表转换为IE8的形象,我应该为IE8还编写。 is there any other way to convert the chart to png. 还有其他方法可以将图表转换为png。 Is it good way to convert the chart in server side. 这是在服务器端转换图表的好方法。 if so please suggest me to get png image file from the server side in java struts2 application. 如果是这样,请建议我从java struts2应用程序的服务器端获取png图像文件。 Thank you in advance. 先感谢您。

If you are also using a <canvas> -element (as in the post you referenced), you can try using ExplorerCanvas , which brings canvas-functionality to old Internet Explorer version (make sure to use conditional tags for loading). 如果您还使用<canvas> -element(如您所引用的文章中所述),则可以尝试使用ExplorerCanvas ,它为旧的Internet Explorer版本带来了画布功能(请确保使用条件标签进行加载)。

Another possibility, as Teemu mentioned, is using VML. 正如Teemu提到的,另一种可能性是使用VML。 I haven't found any script to convert canvas to VML, but I did manage to find this: svg2vml . 我还没有找到任何脚本可以将canvas转换为VML,但是我确实找到了这个脚本svg2vml I guess there should also be variants of this that work with canvas. 我猜也应该有适用于画布的这种变体。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM