I've saved some bitmaps to a database as an array of bytes.
using (var stream = new MemoryStream())
{
bitmap.Save(stream, ImageFormat.Bmp);
stream.Position = 0;
bitmapData = new byte[stream.Length];
stream.Read(bitmapData, 0, (int)stream.Length);
stream.Close();
}
I'd like to transfer the data using MVC4 Web API to a javascript client. Do I need to change anything or is it possible like this? Can I just convert the byte array to a base64 string and use it directly inside image element ?
data:URI.