【问题标题】:How to save a Chart control picture to a file?如何将图表控件图片保存到文件中?
【发布时间】:2012-06-02 18:50:28
【问题描述】:

在 .Net 4.0 WinForms 应用程序中显示带有 System.Windows.Forms.DataVisualization.Charting.Chart 控件的图表,我可以将其渲染保存到图片文件中吗?

【问题讨论】:

    标签: c# .net winforms charts mschart


    【解决方案1】:

    Chart.SaveImage() 方法怎么样?

    【讨论】:

    • 谢谢。我以前从未使用过 Chart 控件,并且在搜索时不知何故错过了该方法。
    【解决方案2】:

    您可以通过传递正确的 ChartImageFormat.* 来使用下面的代码:

    this.chart1.SaveImage("C:\\mycode\\mychart.png", ChartImageFormat.Png);
    

    如果您遇到任何问题,也请查看以下内容: Save Image Using .net ChartSaving higher resolution charts without messing up the appearance

    【讨论】:

      猜你喜欢
      • 2018-08-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-02-18
      • 2012-01-27
      • 1970-01-01
      • 2014-01-27
      • 2015-06-24
      相关资源
      最近更新 更多