算法来源
/// <summary>
/// 根据RGB,计算灰度值
/// </summary>
/// <param name="posClr">Color值</param>
/// <returns>灰度值,整型</returns>
private int GetGrayNumColor(System.Drawing.Color posClr)
{
    
int i = (int)(0.299 * posClr.R + 0.587 * posClr.G + 0.114 * posClr.B);
    
int i2=(posClr.R * 19595 + posClr.G * 38469 + posClr.B * 7472>> 16;
    
return i2;
}

 

相关文章:

  • 2021-12-30
  • 2021-12-10
  • 2021-12-26
  • 2021-12-05
  • 2022-02-25
猜你喜欢
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2022-01-25
  • 2022-12-23
  • 2022-01-16
相关资源
相似解决方案