Error while saving diagram to memoryStream

Hi,
I am using this code to save diagram to memorystream.

DiagramControl dc = new DiagramControl();
System.IO.MemoryStream stream = new System.IO.MemoryStream();
dc.Save(stream as System.IO.Stream);
But i am getting this error
"Object reference not set to an instance of an object."




1 Reply

RT Ramya Thirugnanam Syncfusion Team January 12, 2012 08:23 AM UTC

Hi Nadeem,

With regards to save the diagram to memory stream, this can be achieved by using the Save method of the DiagramControl. We have created a simple sample to represent this. please refer to the sample from the attachment.

Note: While loading from memory stream please make sure the stream’s Position property is set to 0.

For further details about the Export and Import using Streams, please refer to the following online help documentation.

link: http://help.syncfusion.com/ug_94/User%20Interface/WPF/Diagram/index.htm and Navigate to the concepts and features.-> Diagram View-> Export diagram in image format

Please let us know if you have any concerns.
Regards,
Ramya




DiagramviewExport_baf1a268.zip

Loader.
Up arrow icon