private static byte[] BitmapToBytesCode(Bitmap image)
{
using (MemoryStream stream = new MemoryStream())
{
image.Save(stream,ImageFormat.Png);
return stream.ToArray();
}
}
This code only works on Windows. Is it possible to make it system independent?
I have a project that runs on a Linux server and I need to implement one function on this project.
Since System.Drawing.Common
now only support for windows , Try to use ImageSharp
or OpenCvSharp4
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.