繁体   English   中英

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

[英]Can i get an image output for a Developer Express WebChartControl?

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

有没有一种方法可以在运行时获取并保存此图表作为图像输出?

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

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

当然。 最终,图像来自某种URL。 在网页上查看源代码,然后查看该URL的外观。 通过一定程度的逆向工程,使用System.Web.UI.HtmlTextWriter(也许是HttpHandler等),您应该能够得到想要的东西。

使用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)

暂无
暂无

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

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