简体   繁体   中英

dependence on the operating system?

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

https://github.com/SixLabors/ImageSharp

https://github.com/shimat/opencvsharp

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM