Public Sub SavePic()
Dim saveFileDialog1 As 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 Then
Dim format As ChartImageFormat = ChartImageFormat.Bmp
If saveFileDialog1.FileName.EndsWith("bmp") Then
format = ChartImageFormat.Bmp
Else
If saveFileDialog1.FileName.EndsWith("jpg") Then
format = ChartImageFormat.Jpeg
Else
If saveFileDialog1.FileName.EndsWith("emf") Then
format = ChartImageFormat.Emf
Else
If saveFileDialog1.FileName.EndsWith("gif") Then
format = ChartImageFormat.Gif
Else
If saveFileDialog1.FileName.EndsWith("png") Then
format = ChartImageFormat.Png
Else
If saveFileDialog1.FileName.EndsWith("tif") Then
format = ChartImageFormat.Tiff
End If
End If ' Save image
End If
End If
End If
End If
IsMouseMove = False
VChart.ChartAreas(0).CursorX.IsUserEnabled = False
VChart.ChartAreas(0).CursorX.LineDashStyle = ChartDashStyle.NotSet
If VChart.Annotations.IndexOf("游标") >= 0 Then
'X 定位
VChart.Annotations("游标").Visible = False
End If