Hi,

I'm wondering, whether is there any other methods to save the shape into a file?
Meaning that I've already drag few shape and I wanted to save all the shapes, their position, their colour.

What I'm thinking now is, getting all the shape's coordinate, colours, size and save it into a text file.
Then when loading the file, I need to recreate all the shape based on the information of the text file.

Is there any other method in C# which make my saving shape easier?? Such as save with other format, then enable me to load the file easier??

Regards,
Kar Hong

Recommended Answers

All 2 Replies

Hi,

You can also serialize the objects. This will save the object in a file and then you can retrieve then like objects to. Among the clases that you will need to use are FileStream, StreamReader, StreamWriter,..., this clases are in the System.IO namespace. Also you need to mark the class as [Serializable]

Regards,
Camilo

Em, I'll try on the Serialise and then get back to you...

Thank you all for the fast reply!
:twisted:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.