.Net Core控制台项目,添加了 System.Drawing.Common 引用
using System;using System.IO;using System.Drawing;namespace imagetest1 { class Program { static void Main(string[] args) { Console.WriteLine("Hello World!"); byte[] bytes = File.ReadAllBytes("bd_logo1.png"); using (MemoryStream ms = new MemoryStream(bytes)) { Image img = Image.FromStream(ms); Console.WriteLine($"{img.Width},{img.Height}"); } Console.Read(); } } }
在CentOS下报错:
CentOS下要另外安装什么吗?怎么安装?