vb.net中怎么将chart中的图表复制到剪贴板和另存为成图片文件?求大神帮助
1个回答
展开全部
private void Save_Click(object sender, System.EventArgs e) { // Create a new save file dialog SaveFileDialog saveFileDialog1 = new SaveFileDialog(); // Sets the current file name filter string, which determines // the choices that appear in the "Save as file type" or // "Files of type" box in the dialog box. saveFileDialog1.Filter = "Bitmap (*.bmp)|*.bmp|JPEG (*.jpg)|*.jpg|EMF (*.emf)|*.emf|PNG (*.png)|*.png|SVG (*.svg)|*.svg|GIF (*.gif)|*.gif|TIFF (*.tif)|*.tif"; saveFileDialog1.FilterIndex = 2 ; saveFileDialog1.RestoreDirectory = true ; // Set image file format if(saveFileDialog1.ShowDialog() == DialogResult.OK) { ChartImageFormat format = ChartImageFormat.Bmp; if( saveFileDialog1.FileName.EndsWith( "bmp" ) ) { format = ChartImageFormat.Bmp; } else if( saveFileDialog1.FileName.EndsWith( "jpg" ) ) { format = ChartImageFormat.Jpeg; } else if( saveFileDialog1.FileName.EndsWith( "emf" ) ) { format = ChartImageFormat.Emf; } else if( saveFileDialog1.FileName.EndsWith( "gif" ) ) { format = ChartImageFormat.Gif; } else if( saveFileDialog1.FileName.EndsWith( "png" ) ) { format = ChartImageFormat.Png; } else if( saveFileDialog1.FileName.EndsWith( "tif" ) ) { format = ChartImageFormat.Tiff; } else if( saveFileDialog1.FileName.EndsWith( "svg" ) ) { format = ChartImageFormat.Svg; } // Save image Chart1.SaveImage( saveFileDialog1.FileName, format ); } }
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询