I have the following% nested for
that runs the entire length of a bitmap image in C #. I would like to run the second for threads to run parallel.
Bitmap alterado = new Bitmap(original.Width, original.Height);
//Convertendo para tons de Cinza
for (int i = 0; i < original.Width; i++)
{
for (int j = 0; j < original.Height; j++)
{
Color corOriginal = original.GetPixel(i, j);
int escalaCinza = (int)((corOriginal.R * 0.3) + (corOriginal.G * 0.49) + (corOriginal.B * 0.11));
Color CorEmEscalaDeCinza = Color.FromArgb(escalaCinza, escalaCinza, escalaCinza);
alterado.SetPixel(i, j, CorEmEscalaDeCinza);
}
}
return alterado;
How can I do this?