convert bitmap to byte array c# asp.net core code example
Example: bitmap to byte array c#
public static byte[] ImageToByteArray(Image img)
{
using (var stream = new MemoryStream())
{
img.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
return stream.ToArray();
}
}