V
VJ
I am looking for ways to store a picture file as a data element in a XML
file. Is the below the best option available, to convert a picture file to
string format..
string data = null;
Bitmap bmp = new Bitmap(@"e:Image.bmp");
using (MemoryStream mem = new MemoryStream())
{
bmp.Save(mem, System.Drawing.Imaging.ImageFormat.Bmp);
//Convert the bytes to a string.
data = Convert.ToBase64String(mem.ToArray());
}
VJ
file. Is the below the best option available, to convert a picture file to
string format..
string data = null;
Bitmap bmp = new Bitmap(@"e:Image.bmp");
using (MemoryStream mem = new MemoryStream())
{
bmp.Save(mem, System.Drawing.Imaging.ImageFormat.Bmp);
//Convert the bytes to a string.
data = Convert.ToBase64String(mem.ToArray());
}
VJ