windowsforms-devexpress-dot-xtracharts-dot-sankey-dot-sankeydiagramcontrol-dot-loadfromstream-x28-system-dot-io-dot-stream-x29.md
Restores the diagram’s layout from a stream.
Namespace : DevExpress.XtraCharts.Sankey
Assembly : DevExpress.XtraCharts.v25.2.UI.dll
NuGet Package : DevExpress.Win.Charts
public void LoadFromStream(
Stream stream
)
Public Sub LoadFromStream(
stream As Stream
)
| Name | Type | Description |
|---|---|---|
| stream | Stream |
A Stream descendant from which the layout is read.
|
Use the LoadFromStream method to load the diagram’s layout from a stream. To write the diagram layout to a stream, use the SankeyDiagramControl.SaveToStream method. If the specified stream is empty or null ( Nothing in Visual Basic), an exception is raised.
The following code writes a diagram’s layout to a stream and then loads the layout from the stream:
using System.IO;
//...
Stream stream = new MemoryStream();
// Save the diagram.
stream.Seek(0, System.IO.SeekOrigin.Begin);
sankeyDiagramControl1.SaveToStream(stream);
// Load the diagram.
stream.Seek(0, System.IO.SeekOrigin.Begin);
sankeyDiagramControl1.LoadFromStream(stream);
Imports System.IO
'...
Dim stream As Stream = New MemoryStream()
' Save the diagram.
stream.Seek(0, SeekOrigin.Begin)
sankeyDiagramControl1.SaveToStream(stream)
' Load the diagram.
stream.Seek(0, SeekOrigin.Begin)
sankeyDiagramControl1.LoadFromStream(stream)
See Also