2014-07-10 69 views
0

我一直在研究這個話題一段時間了。我知道還有其他問題涉及這個話題,但很多答案我沒有得到工作或導致404 Not Found網頁像這樣的http://www.kendoui.com/code-library/dataviz/chart/kendo-ui-chart-export.aspx。有沒有人有目前的方式將Kendo圖表導出爲JPG或PNG格式?我曾嘗試尋找Inkscape,但我並不熟悉它。劍道圖導出爲JPG或PNG

+1

試試下面的網址http://www.telerik.com/support/code-library/kendo-ui-chart-export爲了解決斷開鏈接 – OnaBai

+0

我下載的轉換SVG指令爲bmp庫。有了這個,我可以在我的pdf中包含渲染圖像。我需要封裝所有這些東西並進行調用。例如 - >繪製散點圖 - >將散點圖轉換爲BMP - >在PDF文檔中包含位圖以便查看和打印。 –

回答

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; 
}