XmlWriter
Bitmap bmp = new Bitmap(imagePath); TypeConverter converter = TypeDescriptor.GetConverter(typeof(Bitmap)); XElement img = new XElement("image", Convert.ToBase64String( (byte[])converter.ConvertTo(bmp, typeof(byte[])))); xmlWriter.WriteStartElement("img"); xmlWriter.WriteString(img.ToString()); xmlWriter.WriteEndElement();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)