0

I'm trying to figure out a way to embed an image into a file in c#.

What I'm doing is to create a file with text inside of it (it uses XML) , and I want a quite big image embedded into it which I then can read from the file along with the XML.

But how do I do that?

I can't put an image file along with the file since the file may be used on different computers and I don't want 100's of image files laying around with the files.

Any ideas would be appreciated!

Tokfrans
  • 1,939
  • 2
  • 24
  • 56
  • It does not smell nice, tt's not a good idea normally to place binary inside XML, but... http://stackoverflow.com/questions/19893/how-do-you-embed-binary-data-in-xml – leonbloy Dec 07 '13 at 14:47
  • @leonbloy. Isn't it what Microsoft Word doing when you put image on the page? – T.S. Dec 07 '13 at 14:49
  • @leonbloy Thanks! I'll try it at least. But why isn't it a good idea? What can go wrong by doing this? – Tokfrans Dec 07 '13 at 15:09
  • Embed the file as base64 in the xml stream. – Ceelie Dec 07 '13 at 22:45

0 Answers0