We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Saving image and coordinates to/from SQL Server Express

Hello ,


I can use Apose Diagram to create Visio like diagrams.

I want to save / retrieve diagrams and connectors to / from the database .

The diagram shall be like https://awwapp.com/s/49/31/3c.png

What data types shall map from/ to Aspose Diagram .NET to/ fro SQL Server Express Edition .

Please let me know.

Thanks
Sujay



Hi Sujay,


Thank you for contacting support.

Well, you can create/modify the Visio drawings. I would like to update you that the VSS / VSX stencil file formats are a set of masters/templates which can be used these purposes. Masters should be present in the stencil. You can use the masters from any other diagram as well, but master names should match the masters present in the diagram or stencil. Furthermore, the AddShape method supports placing shapes on the Visio drawing pages.

Please refer to the Aspose.Diagram API example topics and other details:
http://www.aspose.com/docs/display/diagramnet/Home
http://www.aspose.com/docs/display/diagramnet/Add+and+Connect+Shapes

Please feel free to reply us in case of any confusion or questions.

Hello Imran

My question was about saving and retrieving the drawings from the database. How does ASPOSE store the stencils. Should I save them as bitmaps (https://docs.aspose.com/diagram/net/working-with-images/#extract-all-images-from-a-visio-page) to the database. Would it be the same way, I would store images in the database.

How do I store the connector lines .

Please let me know.

Sujay

Hi Sujay,


Thank you for the clarification. Please note that you can save Visio stencil to the MemoryStream object. It allows us to get an array of bytes and then store the array of bytes into a database field. Please go through a sample help topic where we are saving a Word document to a Database field. You can adopt the same approach: How to Load and Save a Document to Database

Second, if you are saving stencil templates into the database, then no need to save image format of Visio shapes. It is simple to get the shapes from Visio stencil and include them in your existing or new Visio drawing. However, if you think it’s necessary, then you can get Bitmap format of each shape as follows and save it to a database field:
https://forum.aspose.com/t/5616

I hope, this covers all your points. Please free feel to reply us in case of any confusion or questions.

Hello Irfan


Thanks for the links and the explanation.

I want to save the entire drawing ( shapes and connectors ) at http://cosketch.com/Saved/ph5ZI3oI in the database, I would also like to retrieve it from the db after it has been saved

I understand the saving of the word document.
The following line populates the Doc field with the stream value.

// Add the @Doc parameter.
command.Parameters.AddWithValue(“Doc”, stream.ToArray());


What should be the preffered way of saving the entire image- should I save the entire image as a Memorystream or should I save the connector and the shapes differently . I think the latter is a bit cumbersome though.

Please suggest.

Thanks
Sujay



Hi Sujay,


Well, it’s all depend upon the scenario. In case the final output is an image format of a Visio drawing, then you can save the entire image as a MemoryStream object. It looks an easy approach.

We hope, this helps. Please let us know in case of any further assistance.