回复 2楼 xydddaxia
我是初学者,我不太懂哎,我是把数据导入到chart1生成的柱状图下面是我的程序
private void button15_Click(object sender, EventArgs e)
{
//PrintDocument pd = new PrintDocument();
printDocument2.PrintPage += new PrintPageEventHandler
(this.PrintImageHandler);
this.printDialog1.AllowSomePages = true;
this.printDialog1.ShowHelp = true;
printDialog1.Document = printDocument2;
DialogResult Rest = printDialog1.ShowDialog();
if (Rest == DialogResult.OK)
{
printDocument2.Print();
}
}
private void PrintImageHandler(object sender,PrintPageEventArgs ppeArgs)
{
Image curImage = chart1.GetChartBitmap();
Graphics g = ppeArgs.Graphics;
if (curImage != null)
{
// Draw Image using the DrawImage method
g.DrawImage(curImage, 100, 100,
curImage.Width, curImage.Height);
}
}
调试时出现错误说错误
“SoftwareFX.ChartFX.Lite.Chart”并不包含“GetChartBitmap”的定义
那你看我哪儿出错了?该怎么解决?