如何将使用teechart5.ocx控件绘制出来的曲线图保存为jpg格式的图片,用C#实现,求代码
2个回答
展开全部
// 图片导出
private void button10_Click(object sender, EventArgs e)
{
saveFileDialog1.Filter = "Images (*.bmp)|*.bmp|Images(*.jpg)|*.jpg|Images(*.wmf)|*.wmf|Images(*.emf)|*.emf|Images (*.gif)|*.gif|Images (*.png)|*.png|Images (*.tiff)|*.tiff";
saveFileDialog1.ShowDialog();
if(saveFileDialog1.FileName != "")
{
switch(saveFileDialog1.FilterIndex)
{
case 1:
tChartFlow.Export.Image.Bitmap.Save(saveFileDialog1.FileName);
break;
case 2:
tChartFlow.Export.Image.JPEG.Save(saveFileDialog1.FileName);
break;
case 3:
tChartFlow.Export.Image.Metafile.Enhanced = false;
tChartFlow.Export.Image.Metafile.Save(saveFileDialog1.FileName);
break;
case 4:
tChartFlow.Export.Image.Metafile.Enhanced = true;
tChartFlow.Export.Image.Metafile.Save(saveFileDialog1.FileName);
break;
case 5:
tChartFlow.Export.Image.GIF.Save(saveFileDialog1.FileName);
break;
case 6:
tChartFlow.Export.Image.PNG.Save(saveFileDialog1.FileName);
break;
case 7:
tChartFlow.Export.Image.TIFF.Save(saveFileDialog1.FileName);
break;
}
}
}
private void button10_Click(object sender, EventArgs e)
{
saveFileDialog1.Filter = "Images (*.bmp)|*.bmp|Images(*.jpg)|*.jpg|Images(*.wmf)|*.wmf|Images(*.emf)|*.emf|Images (*.gif)|*.gif|Images (*.png)|*.png|Images (*.tiff)|*.tiff";
saveFileDialog1.ShowDialog();
if(saveFileDialog1.FileName != "")
{
switch(saveFileDialog1.FilterIndex)
{
case 1:
tChartFlow.Export.Image.Bitmap.Save(saveFileDialog1.FileName);
break;
case 2:
tChartFlow.Export.Image.JPEG.Save(saveFileDialog1.FileName);
break;
case 3:
tChartFlow.Export.Image.Metafile.Enhanced = false;
tChartFlow.Export.Image.Metafile.Save(saveFileDialog1.FileName);
break;
case 4:
tChartFlow.Export.Image.Metafile.Enhanced = true;
tChartFlow.Export.Image.Metafile.Save(saveFileDialog1.FileName);
break;
case 5:
tChartFlow.Export.Image.GIF.Save(saveFileDialog1.FileName);
break;
case 6:
tChartFlow.Export.Image.PNG.Save(saveFileDialog1.FileName);
break;
case 7:
tChartFlow.Export.Image.TIFF.Save(saveFileDialog1.FileName);
break;
}
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询