请高手帮我看段代码
这段代码是我从网上复制的,是用在web上的
我想把它改成在winfrom上,但是,最后一句 保存输出 图像时出错
请高手帮忙。
string[] month = new string[12] { "一月 ", "二月 ", "三月 ", "四月 ", "五月 ", "六月 ", "七月 ", "八月 ", "九月 ", "十月 ", "十一月 ", "十二月 " };
float[] d = new float[12] { 20.5F, 60, 10.8F, 15.6F, 30, 70.9F, 50.3F, 30.7F, 70, 50.4F, 30.8F, 20 };
//画图初始化
Bitmap bMap = new Bitmap(500, 500);
Graphics gph = Graphics.FromImage(bMap);
gph.Clear(Color.White);
PointF cPt = new PointF(40, 420);//中心点
PointF[] xPt = new PointF[3] { new PointF(cPt.Y + 15, cPt.Y), new PointF(cPt.Y, cPt.Y - 8), new PointF(cPt.Y, cPt.Y + 8) };//X轴三角形
PointF[] yPt = new PointF[3] { new PointF(cPt.X, cPt.X - 15), new PointF(cPt.X - 8, cPt.X), new PointF(cPt.X + 8, cPt.X) };//Y轴三角形
gph.DrawString( "某工厂某产品月生产量图表 ", new Font( "宋体 ", 14), Brushes.Black, new PointF(cPt.X + 60, cPt.X));//图表标题
//画X轴
gph.DrawLine(Pens.Black, cPt.X, cPt.Y, cPt.Y, cPt.Y);
gph.DrawPolygon(Pens.Black, xPt);
gph.FillPolygon(new SolidBrush(Color.Black), xPt);
gph.DrawString( "月份 ", new Font( "宋体 ", 12), Brushes.Black, new PointF(cPt.Y + 10, cPt.Y + 10));
//画Y轴
gph.DrawLine(Pens.Black, cPt.X, cPt.Y, cPt.X, cPt.X);
gph.DrawPolygon(Pens.Black, yPt); <