Back to Devexpress

DiagramControl.SaveDocument(Stream) Method

windowsforms-devexpress-dot-xtradiagram-dot-diagramcontrol-dot-savedocument-x28-system-dot-io-dot-stream-x29.md

latest3.0 KB
Original Source

DiagramControl.SaveDocument(Stream) Method

Saves the diagram to the specified stream.

Namespace : DevExpress.XtraDiagram

Assembly : DevExpress.XtraDiagram.v25.2.dll

NuGet Package : DevExpress.Win.Diagram

Declaration

csharp
public void SaveDocument(
    Stream stream
)
vb
Public Sub SaveDocument(
    stream As Stream
)

Parameters

NameTypeDescription
streamStream

The stream where the diagram will be saved.

|

Remarks

To load a saved diagram, use DiagramControl.LoadDocument.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SaveDocument(Stream) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

how-to-handle-diagramcontrol-events-to-save-diagrams-to-a-database-instead-of-a-file-system-t360920/CS/XtraDiagram.CustomDiagramStorage/DiagramStorageInitializer.cs#L30

csharp
using(var stream = new MemoryStream()) {
    diagram.SaveDocument(stream);
    var diagramData = new DiagramData() {

how-to-handle-diagramcontrol-events-to-save-diagrams-to-a-database-instead-of-a-file-system-t360920/VB/XtraDiagram.CustomDiagramStorage/DiagramStorageInitializer.vb#L20

vb
Using stream = New MemoryStream()
    diagram.SaveDocument(stream)
    Dim diagramData = New DiagramData() With {.Name =(i + 1).ToString() & " items", .Data = stream.ToArray()}

See Also

DiagramControl Class

DiagramControl Members

DevExpress.XtraDiagram Namespace