3

I have a image that I need to embed in XML and then retrieve the image using C#. How can I do this?

1
  • Please provide more information about your specific scenario. It's too abstract question. Commented Jun 3, 2010 at 11:14

4 Answers 4

10

Convert it to a byte[] and convert this to a Base64 datablock (using Convert.ToBase64String()), which you put into the xml. On the other side, you simply have to decode it with Convert.FromBase64String() and deal with the resulting byte[] the way you like.

Sign up to request clarification or add additional context in comments.

Comments

0

Either you have to include binary data in XML tags; or you need to put the image somewhere else and send the link with your XML

Comments

0

you can convert your image into base64 data and write in xml !

help:

code snippet

stackoverflow discussion

Comments

0

embed image in xml? You mean putting image in a xml document?

See the link http://www.codeproject.com/KB/cs/lookchanger.aspx

1 Comment

I think he means transferring an image via xml. ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.