Jump to content

Recommended Posts

Posted

I'm currently trying to create a report in XML which will be read by another piece of software and I need to include photos in that report. I have created the report and it exports the data as expected.

 

My question is, what format is the photo data in? ie. If I were to programmatically import that data, what format is it? Hope someone can help.

Posted

Well, having actually read the XML schema, I have realised it is base64binary data.

 

So, the following snippet of c# code will convert it back into an image:

 

string original 'stick photo data here';
byte[] todecode = Convert.FromBase64String(original);
MemoryStream ms = new MemoryStream(todecode);
Image img = Image.FromStream(ms);

 

Then you can use that how you please :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...