Search code examples
c#imagetextrichtextboxread-write

Save text and image files from richtextbox to extern File


I have a question regarding the storage of text and image files from a RichTextBox in an external file.

My problem: I am developing a program for task management. I have developed my own project for the RichTextBox to implement the drag and drop of image files like Outlook. It all works perfectly, but I cant save the text and the image files together. For example: XML document can only store a text string. At the moment I have managed to save the text and the image path individually and then read out sequentially. It works fine, but now the images no longer are on their initial position.

I've been thinking about the images to convert, save and convert back while reading, but I really do not get the position in the RichTextBox to the series.

I would like to know if anyone has a solution to this issue and thank you in advance for the time.


Solution

  • You could convert the image into a string and store that into the xml.Take a look at the following link: Convert image to string