I'm trying to build a .net web API to send images from my service to android device, unfortunately the company that i work have a system such as i cant take the images via URL, i have tried Base64 to send the images to my phone but its too slow, can anyone help me. how can i send the images from my service to android (GET API) fast. this is a part from my API:
string base64String = "";
using (Image image = Image.FromFile(DALParameter.GetByCode(PATH)
{
using (MemoryStream m = new MemoryStream())
{
image.Save(m, image.RawFormat);
byte[] imageBytes = m.ToArray();
// Convert byte[] to Base64 String
base64String = Convert.ToBase64String(imageBytes);
}
}