我想创建一个应用程序,我可以使用带有对象的黑色背景捕获图像,并将图像路径传递给算法,以计算图像中对象的大小。
我们正在做什么:使用带有对象的黑色背景捕获图像。
算法:算法是用C#Windows兼容模式编写的。该算法删除黑色背景,并在裁剪后使用(System.Drawing dll)返回对象的大小。 该算法在桌面应用程序中运行良好。
我们正在尝试在Xamarin Android中转换应用程序。我们在运行时发现了一些问题。
错误: System.TypeInitializationException:'Gdip'的类型初始值设定项引发了异常。 ---> System.Drawing.Bitmap..ctor中的System.EntryPointNotFoundException(System.String filename“
var bmp = new Bitmap(App._file.Path); //App._file Path Path from camera image
var filter = new Grayscale(0.2125, 0.7154, 0.0721);
Bitmap grayImage = filter.Apply(bmp);
那么我该怎么做才能解决这个问题?