下面的示例演示了如何把图表保存到内存流,然后恢复。
C# | 复制代码 |
---|
using System.IO;
Stream stream = new MemoryStream();
stream.Seek(0, System.IO.SeekOrigin.Begin);
chartControl1.SaveToStream(stream);
stream.Seek(0, System.IO.SeekOrigin.Begin);
chartControl1.LoadFromStream(stream);
|
Visual Basic | 复制代码 |
---|
Imports System.IO
Dim stream As System.IO.Stream
stream = New System.IO.MemoryStream()
stream.Seek(0, System.IO.SeekOrigin.Begin)
ChartControl1.SaveToStream(stream)
stream.Seek(0, System.IO.SeekOrigin.Begin)
ChartControl1.LoadFromStream(stream)
|