I am making an app in C# using Mono and I am referencing system.Drawing library which is giving me an error.
Error CS0433 The type 'Color' exists in both 'Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' and 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
I tried to use
using color2 = Android.Graphics;
using Color1 = System.Drawing;
but The error still exists. this code :
public static Color1.Bitmap FromDoublesToGrayscal(double[,] doubles)
{
var result = new Color1.Bitmap(doubles.GetLength(0), doubles.GetLength(1));
for (int x = 0; x < result.Width; x++)
for (int y = 0; y < result.Height; y++)
{
int level = (int)Math.Round(doubles[x, y] * 255);
if (level > 255) level = 255; // just to be sure
if (level < 0) level = 0; // just to be sure
result.SetPixel(x, y, Color1.Color.FromArgb(level, level,level));
}
return result;
}