我可以获得Developer Express WebChartControl的图像输出吗?

时间:2008-09-05 18:42:16

标签: asp.net devexpress webchartcontrol

我的网页上有一个WebChartControl。生成图表时,正在生成图像并显示在页面上。

有没有办法在运行时获取并保存此图表作为图像输出?

3 个答案:

答案 0 :(得分:1)

不确定。最终,图像来自某种URL。在网页上执行查看源并查看该URL的外观。通过一定量的逆向工程,使用System.Web.UI.HtmlTextWriter,也许是一个HttpHandler等,你应该能够得到你想要的东西。

答案 1 :(得分:1)

从Developer Express图表控件(Web)导出图像的最佳解决方案是:

((IChartContainer)[Your web chart control]).Chart.ExportToImage([Your file name], ImageFormat.Png);

答案 2 :(得分:0)

使用ChartControl对象的ExportToImage方法。这是WinForm代码,但对于WebChartControl,同样的概念应该成立:

    Dim chart As ChartControl = ChartControl1.Clone()
    chart.Size = New Size(800, 600)
    chart.ExportToImage("file.png", System.Drawing.Imaging.ImageFormat.Png)