Ok so , I found this cool code and I can’t use it. You see … We have to input an Image
which I can do it but we also need to Input Colors which I dont know how to do it…
public static Bitmap Colorize(Bitmap Image, Color[] Colors)
{
if (Colors.Length < 256)
return null;
Bitmap TempBitmap = new Bitmap(Image.Width, Image.Height);
for (int x = 0; x < Image.Width; ++x)
{
for (int y = 0; y < Image.Height; ++y)
{
int ColorUsing = Image.GetPixel(x, y).R;
TempBitmap.SetPixel(x, y, Colors[ColorUsing]);
}
}
return TempBitmap;
}
You need to pass in an array of Color objects, as follows:
Of course, looking at the method, it looks like you need to fill the Color array with at least 256 colors.
I would recommend you read up on arrays.