剑道图表导出为JPG或PNG

时间:2014-07-10 15:29:13

标签: asp.net-mvc kendo-ui

我一直在研究这个话题。我知道还有其他问题涉及这个主题,但很多答案我还没有开始工作或导致404 Not Found这样的网页http://www.kendoui.com/code-library/dataviz/chart/kendo-ui-chart-export.aspx。有没有人有目前的方法将剑道图表导出到JPG或PNG?我试过看Inkscape但我根本不熟悉它。

1 个答案:

答案 0 :(得分:0)

使用nuGet库svg并发布可能对您有用的花絮。您可以从和获取svgFileContents。

public BitMap RenderReportFromSVG(string svgFileContents)
{
     System.Drawing.Bitmap _bitmap=null;
     byte[] byteArray = Encoding.ASCII.GetBytes(svgFileContents);
     using (var stream = new MemoryStream(byteArray))
     {
          XmlDocument xdoc=new XmlDocument();
          xdoc.LoadXml(svgFileContents);
          var svgDocument = SvgDocument.Open(xdoc);
          _bitmap = svgDocument.Draw();                
     }
     return _bitmap;
 }
相关问题