Created
December 27, 2019 12:29
-
-
Save SumindaD/4c76293e5472f3523bbf15e6dfc568a6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Serialize an image byte[] to an XML byte[] | |
/// </summary> | |
/// <param name="imageBuffer">Byte[] of the image to be serialized into XML</param> | |
/// <returns>Byte[] of the XML</returns> | |
private static byte[] SerializeImageToXML(byte[] imageBuffer) | |
{ | |
XmlSerializer x = new XmlSerializer(typeof(byte[])); | |
using (MemoryStream myFileStream = new MemoryStream()) | |
{ | |
x.Serialize(myFileStream, imageBuffer); | |
return myFileStream.ToArray(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment