//on parcout l'image pixel par pixel et on calcule a chaque fois le niveau de gris correspondant
maclasse::ToGrayScale(Bitmap* planche)
{
for(UINT y = 0; y < planche->GetHeight(); y++)
{
for(UINT x = 0;x < planche->GetWidth(); x++)
{
Color c;
planche->GetPixel(x, y,&c);
int luma = (int)((c.GetRed() * 0.3) + (c.GetGreen() * 0.59)+ (c.GetBlue() * 0.11));
ARGB argb = Color::MakeARGB(c.GetAlpha(), luma, luma, luma);
Color argbColor(argb);
planche->SetPixel(x, y, argbColor);
}
}
}