J
James dean
The following code is the current method i have for converting an image
to Base64.Is this the most efficient way to convert an image to base64
or are there others. The Image class's Save method is slow here and i am
wondering if i can do it some other way to make it faster.....Any ideas
public string ImageToBase64String(Image imageData ImageFormat format)
{
string base64;
MemoryStream memory = new MemoryStream();
imageData.Save(memory, format);
base64 = System.Convert.ToBase64String(memory.ToArray());
memory.Close();
memory = null;
return base64;
}
to Base64.Is this the most efficient way to convert an image to base64
or are there others. The Image class's Save method is slow here and i am
wondering if i can do it some other way to make it faster.....Any ideas
public string ImageToBase64String(Image imageData ImageFormat format)
{
string base64;
MemoryStream memory = new MemoryStream();
imageData.Save(memory, format);
base64 = System.Convert.ToBase64String(memory.ToArray());
memory.Close();
memory = null;
return base64;
}