title: i do not know how to convert from 'float' to 'int'
body: <p>i'm learning programming , and i'm stuck on this error for a long time</p>
  
  <p>i tried changing variable to float</p>
  
  <pre><code>        Color col;
          float red, green, blue,gray;
  
          for (int i = 0; i &lt; oImage.Width; i++)
              for (int j = 0; j &lt; oImage.Height; j++)
              {
                  col = oImage.GetPixel(i, j);
                  red = col.R;
                  green = col.G;
                  blue = col.B;
                  gray = red*0.21 + green*0.72 + blue*0.07;
  
  
               oImage.SetPixel(i, j, Color.FromArgb(gray, gray, gray));
  
              }
  
          picImage.Refresh();
  </code></pre>
  
  <p>i expect the output is to convert a normal photo to a luminosity background</p>