0

我正在尝试另存为我的程序创建的 zedgraph 图。问题是,当我使用该代码时,它会保存图像,但只显示条形顶部的标签......没有显示条形。

 chart1.SaveAs();

我错过了什么吗?

创建图表的代码:

GraphPane myPane = chart1.GraphPane;
        myPane.XAxis.Scale.Format = "F0";
        //create the bars
        BarItem myCurve = myPane.AddBar("Width", pointPairListWidth, Color.Black);
        myCurve.Bar.Fill.Type = FillType.Solid;
        BarItem myCurve2 = myPane.AddBar("Height", pointPairListHeight, Color.Gray);
        BarItem.CreateBarLabels(myPane, false, "f0");
        chart1.AxisChange();
        chart1.Invalidate();
        chart1.Refresh();

回答:

 chart1.GraphPane.GetImage().Save("pic.jpg");
4

1 回答 1

0

你可以试试zedGraphControl.MasterPane.GetImage().Save("test.bmp")

编辑: 自从我使用 zedGraph 以来很久以前,但是您正在将这些条添加到您的myPane-object 中。那你能行myPane.SaveAs()吗?

于 2013-02-28T22:57:44.803 回答